I'm new to AWS and looking at CDK and SAM for CI/CD and process automation at a startup. Which would you recommend starting with?
CDK or SAM for a startup that's new to AWS?
Answers
I'd lean toward CDK if the automation will involve a mix of AWS services. You define infrastructure in a programming language such as TypeScript or Python, and its constructs can help you reuse configuration across environments.
That flexibility comes with software maintenance though. The team needs to agree on a language, manage dependencies and understand what the constructs deploy. CDK generates CloudFormation, so learning the underlying AWS resources still matters.
Reply to this answer
SAM is worth considering if the work is mostly serverless and you want a straightforward way to define and deploy Lambda-based applications. Its local invocation and API testing tools can be handy for the function development loop.
It's more focused than CDK. Once the setup reaches beyond SAM's serverless abstractions, you may be writing more CloudFormation directly. That isn't automatically a problem, but consider whether your team prefers templates or application code.
Reply to this answer
Don't limit the comparison to those two. Terraform is another option for infrastructure automation, particularly if you want a tool that isn't tied to one cloud. Its configuration language is another thing to learn, though, and cloud portability doesn't mean the AWS resources themselves become generic.
CDK's familiar programming languages can be appealing, but the team still has to settle on one and maintain the code. I'd compare the skills you expect to have on the team, not just the syntax.
Reply to this answer
Since this is your first time with AWS, the tool choice isn't the biggest risk. Spend time learning IAM, security, costs, resilience and how deployments will be operated before putting production workloads behind a pipeline.
Some AWS training or a review from someone experienced could save a lot of cleanup. Neither CDK nor SAM makes those architecture decisions for you.
Reply to this answer
Add your answer
Answers are reviewed before publication.
_p81+gearfeather.6:
Being able to test and refactor infrastructure code is a nice benefit, especially when several environments need similar setups.