How to choose between AWS CloudFormation, Terraform, and AWS CDK (DEV309)

Rapid Learning of Infrastructure as Code Tools

Evolution of Infrastructure as Code

  • Infrastructure as code (IaC) started around 2011-2012 with the launch of AWS CloudFormation
  • Terraform was launched in 2014, followed by AWS CDK in 2018
  • The evolution of IaC tools has provided developers with more choices and flexibility

Rapid Learning Exercise: Deploying a Tickerbox Application

  • The Tickerbox application is a simple website where users can create and share lists
  • The architecture uses CloudFront, a VPC, Lambda, and DynamoDB
  • The speaker will demonstrate how to deploy this application using Terraform, CloudFormation, and AWS CDK

Terraform

  • Terraform L1 (low-level): Manually defining resources using Terraform configuration
  • Terraform L2 (medium-level): Using Terraform modules to simplify resource definitions
  • Terraform L3 (high-level): Sharing Terraform modules across multiple teams

CloudFormation

  • CloudFormation templates can quickly become complex, with hundreds of lines of code
  • The Scepter tool can be used to structure CloudFormation projects and share templates across teams

AWS CDK

  • AWS CDK L1 (low-level): Directly defining CloudFormation resources using a programming language
  • AWS CDK L2 (medium-level): Using higher-level constructs to simplify resource definitions
  • AWS CDK L3 (high-level): Creating reusable patterns and best practices for your organization

Choosing the Right Tool

  1. Decide if you want to use CloudFormation or Terraform
  2. Determine if you want to use AWS CDK or not
  3. Choose between L1, L2, or L3 implementation

Anti-Patterns to Avoid

  1. Highly opinionated and complex code that is difficult to maintain
  2. Letting the "experts" or "fans" choose the tool without considering the team's needs
  3. Asking customers to build infrastructure without providing them with a sandbox
  4. Over-engineering solutions and neglecting the human effort required
  5. Underestimating the knowledge gap when onboarding new team members

Key Takeaways

  1. Think about how you use the tools (L1, L2, or L3)
  2. Simplify and share knowledge to make the "right thing" the "easy thing"
  3. Consider the different needs of partners and customers when choosing tools

Feedback and Resources

  • Provide feedback to the speaker using the provided QR code or their LinkedIn profile
  • The demo code is available on GitHub, where you can also contribute and provide feedback

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.

Talk to us