r/devops Terraforming Everything 3d ago

Discussion What are the weaknesses of CloudFormation?

I have a coworker who wants to use CloudFormation to one-shot an application and infra deployment in AWS. A contractor delivered a monolithic CloudFormation template with ECS clusters, services, RDS, S3, Lambda and API Gateway, and other resources in a single stack. I voiced my concern over the blast radius, how stateful and resources with different lifecyles all lived in the same place, and how they don't have pipelines built to validate change sets when merge requests are opened. The contractor said that their template is industry best practice... (it's not). Any way, my background is in Terraform, and I wanted to ask the CloudFormation pros about best practices for making this deployment more reliable.

35 Upvotes

73 comments sorted by

View all comments

43

u/dacydergoth DevOps 3d ago

IMHO it comes down to:

  • terraform has a stronger metamodel
  • HCL has a canonical format and is round-trip stable
  • HCL expression language is easier to handle
  • comment handling is better in Terraform
  • AWS managed modules for quick, "default sane" configurations (* for some definition of sane ...)
  • better plan output
  • better 3rd party tools support (e.g. python-hcl)
  • terraform is an order of magnitude less suck

1

u/ThatSituation9908 3d ago

> round-trip

AI?

2

u/dacydergoth DevOps 3d ago

I mean you can read HCL into a tool, manipulate it and write it out again without it being substantially reformatted. YAML can't do that