Use AWS CloudFormation if everything you run lives on AWS and you want infrastructure as code built into the platform, with no additional charge for native AWS resources. Use Terraform if you work across several clouds or services, because its providers manage almost anything with an API, from AWS, Azure and Google Cloud to GitHub and Datadog. Both describe infrastructure in text files you can version; CloudFormation groups resources into stacks, while Terraform follows a Write, Plan and Apply workflow.
Both tools turn infrastructure into code, so the choice comes down to scope. I read HashiCorp's Terraform introduction and plans page and AWS's CloudFormation user guide, product page and charges page.
Terraform and CloudFormation at a glance
| Terraform | AWS CloudFormation | |
|---|---|---|
| Made by | HashiCorp, sold as part of IBM's HashiCorp Cloud Platform | Amazon Web Services |
| Scope | Thousands of providers across clouds and services | AWS resources, plus registry extensions |
| How you describe resources | Human-readable configuration files | Templates describing AWS resources |
| Unit of deployment | Configuration applied through Write, Plan, Apply | Stacks you create and delete as one |
| Preview before changing | Plan shows what it will create, update or destroy | Not detailed on the pages I read |
| Charges | Managed IBM HCP Terraform plans charge per managed resource | No additional charge for AWS::* resources |
How each one charges you
This is where the two differ most for a small team. AWS's CloudFormation plans page says there's no additional charge for using CloudFormation with resource providers in the AWS::* and Alexa::* namespaces; you pay for the AWS resources you create, the same as if you'd made them by hand. Charges only apply per handler operation when you use registry extensions, such as third-party resource providers and hooks.
HashiCorp's plans page now sells Terraform as part of the IBM HashiCorp Cloud Platform. The managed IBM HCP Terraform tiers, Essentials, Standard and Premium, charge per managed resource each month, with a trial credit to get started, while IBM Terraform Enterprise is the self-managed option for companies with strict compliance needs.
Why teams choose Terraform
The Terraform docs describe it as a tool for defining cloud and on-premises resources in human-readable configuration files you can version, reuse and share. Providers let it work with virtually any platform or service with an accessible API, and HashiCorp and the community have written thousands of them, published on the Terraform Registry, covering AWS, Azure, Google Cloud, Kubernetes, Helm, GitHub, Splunk and Datadog. Its core workflow is Write, Plan and Apply, so you see the planned changes before anything happens.
Why teams choose CloudFormation
The CloudFormation user guide puts it simply: you create a template that describes the AWS resources you want, such as EC2 instances or RDS databases, and CloudFormation provisions them as a stack. Delete the stack and every resource in it goes too. Because templates are text files, you can keep them in version control and reuse them to build the same setup in another region, which makes environments consistent and repeatable.
A quick way to decide
- All your infrastructure is on AWS and likely to stay there: CloudFormation.
- You use two or more clouds, or manage SaaS tools like GitHub as code: Terraform.
- You want to see a plan of changes before applying them: Terraform's Plan step shows it.
- You want to tear down a whole environment in one go: CloudFormation stacks make that easy.
- You'd like no extra tool to pay for on top of AWS: CloudFormation has no additional charge for native resources.
For the wider context, read my take on why AWS stands out as a cloud provider, and this look at a cloud management suite shows how teams keep several clouds in order.
My advice on Terraform or CloudFormation
If you're an AWS-only business, start with CloudFormation; it's built in, has no extra charge for native resources and keeps your stack in one place. If you already use more than one cloud, or want GitHub, Datadog and DNS managed alongside your servers, learn Terraform instead, because one workflow covers them all. Whichever you pick, keep your templates or configuration files in version control from day one.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
Do you make infrastructure as code or cloud tools? Tool makers can ask to be considered for a featured place in comparisons like this one.
Frequently asked questions
Is CloudFormation free?
AWS says there's no additional charge for CloudFormation with AWS::* and Alexa::* resource providers. You pay for the AWS resources it creates, and registry extensions are charged per handler operation.
Does Terraform work with AWS?
Yes. AWS is one of thousands of providers on the Terraform Registry, alongside Azure, Google Cloud, Kubernetes and GitHub.
Who owns Terraform now?
HashiCorp's plans page sells Terraform as part of the IBM HashiCorp Cloud Platform, with IBM HCP Terraform and IBM Terraform Enterprise.
What is a CloudFormation stack?
A stack is the set of AWS resources CloudFormation creates from a template. You can delete the stack to remove all of its resources at once.
Can Terraform manage more than one cloud?
Yes. Terraform's docs say its providers work with virtually any platform or service that has an accessible API.


