DEV Community

AWS Bites

31. CloudFormation or Terraform?

Should I use CloudFormation or should I use Terraform instead? If you are just starting to do Infrastructure as Code (IaaC) you probably have this question. In this episode we will discuss in detail how these two amazing pieces of technology compare against each other and what their features, weaknesses and strengths are. We will share our opinions based on our experience with these 2 technologies and guess what, for once we have a bit of clash of opinions! Can you guess who is in the Terraform camp and who is in the CloudFormation camp instead?

In this episode, we mentioned the following resources:

- A tutorial on how to create resources conditionally with CDK (and CloudFormation): https://loige.co/create-resources-conditionally-with-cdk

- An article to understand in depth how to use secrets management with SSM and SecretsManager together with CloudFormation: https://dev.to/eoinsha/3-ways-to-read-ssm-parameters-4555

- Ben Kehoe’s tweet about switching from CloudFormation to Terraform: https://twitter.com/ben11kehoe/status/1158758917515763712

- Terraform null resources: https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource

- CloudFormation Macros: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/macros-example.html

- How to workaround missing CloudFormation features (by Cloudonaut): https://cloudonaut.io/three-and-a-half-ways-to-workaround-missing-cloudformation-support/

- Org-formation: https://github.com/org-formation/org-formation-cli

- How to create accounts in an org with Terraform: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/organizations_account

- Control Tower Account Factory for Terraform: https://learn.hashicorp.com/tutorials/terraform/aws-control-tower-aft

- Pulumi: https://www.pulumi.com/

- Cloudonaut’s comparison of CloudFormation with Terraform: https://cloudonaut.io/cloudformation-vs-terraform/

- Cloudonaut’s free CloudFormation templates: https://templates.cloudonaut.io/en/stable/

Do you have any AWS questions you would like us to address?


Leave a comment here or connect with us on Twitter:
- https://twitter.com/eoins
- https://twitter.com/loige

Episode source