2 min read

Why CloudFormation

People often say I should use CDK or Terraform. In this post I explain why I use CloudFormation and why you should at least understand CloudFormation.
Why CloudFormation

People have asked why I use CloudFormation (CFN) and not other tools such as Terraform or AWS Cloud Development Kit (CDK). There are several reasons for this.

Firstly, I'm not a developer. I come from an infrastructure background and although understand scripting and programming constructs it's not my expertise. This means no matter what tool I had to learn it was all relatively new to me.

Secondly, when I started my Infrastructure as Code (IaC) journey Terraform had been out for less than a year. I was also working with AWS engineers who only dealt in CFN templates and the boot-camp I attended at re:invent 2015 all focused on CFN.

Finally, no matter if you use CFN or another tool it all ends up as a CFN Template deployed in the account. So my view is that if you understand CFN and how it works natively you will be able to transfer all those skills to other tooling if you chose to do so.

That aside, here are my thoughts on CFN vs Terraform and CDK

CloudFormation vs Terraform

To me Terraform was sold as a single coding solution for multi-cloud. Something  where you could write code that was cloud agnostic such as "I want 1 server" and Terraform would handle the rest. Sounds great right! However I have found that it's not so easy. Rather than one piece of code that can be run against multiple clouds you still need to re-write code if you move between clouds. Don't get me wrong Terraform offers several advantages over CloudFormation and often has capabilities before they are available native in AWS tooling. But if I am only going to use AWS there are benefits for not using it and in some instances you might choose to forgo the extra options to be 100% AWS native.

Terraform by HashiCorp
Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.

CloudFormation vs CDK

I think CDK is AWS' attempt and keeping people from going to Terraform, although it does offer integration with Terraform. It moves from the YAML/JSON approach and allows infrastructure to be written in a number of programming languages such as Python, Java and GO. For me this is suited to full/native DevOps teams that can choose a single programming language and write both the infrastructure and application all in the same language.

AWS Cloud Development Kit - Amazon Web Services
AWS Cloud Development Kit (CDK) is a software development framework to model and provision your cloud application resources using familiar programming languages.