"Should we use Terraform or CloudFormation?"
I get asked this at least once a week. And my answer is always the same: "It depends." But that's not helpful, so let me actually explain what it depends on.
After using both tools extensively across dozens of projects—from startups to enterprises—here's what I've learned about when each one shines.
TL;DR - The Quick Answer
- Choose Terraform if you use multiple clouds, want a larger ecosystem, or need maximum flexibility
- Choose CloudFormation if you're 100% AWS, want native integration, or need AWS support
Now let's dig into why.
What Are We Actually Comparing?
Both are Infrastructure as Code (IaC) tools that let you define cloud resources in configuration files instead of clicking through consoles. But they come from very different places:
Terraform — Built by HashiCorp, open-source (mostly), works with ANY cloud provider plus hundreds of other services.
CloudFormation — Built by AWS, free to use, works ONLY with AWS services.
Terraform: The Multi-Cloud Swiss Army Knife
Terraform has become the de facto standard for Infrastructure as Code, and for good reason. It's flexible, powerful, and has an enormous ecosystem.
What I Love About Terraform
- Multi-cloud support — AWS, Azure, GCP, Kubernetes, Cloudflare, Datadog... one language for everything.
- HCL is actually readable — HashiCorp Configuration Language is cleaner than YAML/JSON. Fight me.
- State management — The state file tracks what exists. You can import existing resources, move things around, target specific resources.
- Massive module ecosystem — The Terraform Registry has thousands of pre-built, community-tested modules.
- Plan before apply — "terraform plan" shows you exactly what will change. No surprises.
- Huge job market — Terraform skills are in high demand. Good for your career.
What Frustrates Me About Terraform
- State file management — The same feature that makes it powerful can cause headaches. State corruption, locking issues, team coordination...
- Provider lag — When AWS releases new features, there's often a delay before the Terraform provider supports them.
- BSL license controversy — HashiCorp switched from open-source to Business Source License in 2023. Some teams are concerned.
- Learning curve — HCL, providers, modules, workspaces, backends... there's a lot to learn.
💡 Terraform Verdict: The safest choice for most teams. Even if you're AWS-only today, Terraform skills transfer everywhere.
CloudFormation: The AWS Native Option
CloudFormation is AWS's own IaC service. It's deeply integrated with AWS and often gets new feature support before Terraform.
What I Love About CloudFormation
- Zero setup — No state files to manage, no backends to configure. Just upload and go.
- Day-one feature support — New AWS services usually have CloudFormation support from launch.
- Drift detection — CloudFormation can detect when resources have been changed outside of IaC.
- AWS support — If something breaks, you can open an AWS support ticket. Try that with Terraform.
- StackSets — Deploy the same template across multiple accounts and regions easily.
- Free — No licensing concerns, no paid tiers. It's just part of AWS.
What Frustrates Me About CloudFormation
- AWS only — You literally cannot use it for anything outside AWS. That's a big limitation.
- YAML/JSON pain — CloudFormation templates are verbose. A simple Lambda function can be 200+ lines.
- Slow deployments — Stack updates can be painfully slow, especially for large stacks.
- Rollback hell — When a stack update fails, the rollback can take forever and sometimes gets stuck.
- Limited reusability — Nested stacks exist but aren't as elegant as Terraform modules.
💡 CloudFormation Verdict: Great if you're 100% committed to AWS and want the simplest possible setup. But you're trading flexibility for convenience.
Head-to-Head Comparison
Multi-Cloud Support: Terraform ✅ | CloudFormation ❌
State Management: Terraform (manual) | CloudFormation (automatic)
Language: Terraform (HCL) | CloudFormation (YAML/JSON)
New AWS Features: Terraform (delayed) | CloudFormation (day-one)
Module Ecosystem: Terraform (huge) | CloudFormation (limited)
Vendor Support: Terraform (HashiCorp) | CloudFormation (AWS)
Cost: Terraform (free/paid tiers) | CloudFormation (free)
My Decision Framework
Choose Terraform If:
- You use (or might use) multiple cloud providers
- You need to manage non-AWS resources (Kubernetes, Datadog, PagerDuty, etc.)
- You want a large ecosystem of pre-built modules
- Your team already knows Terraform (or you want transferable skills)
- You need granular control over what gets deployed
Choose CloudFormation If:
- You're 100% AWS and will stay that way
- You need day-one support for new AWS features
- You don't want to manage state files
- You need official AWS support
- You're using AWS CDK (which compiles to CloudFormation)
What About AWS CDK?
Quick mention: AWS CDK (Cloud Development Kit) lets you write infrastructure in Python, TypeScript, or other languages. It compiles down to CloudFormation templates.
If you hate YAML but want to stay in the AWS ecosystem, CDK is worth considering. You get the power of a real programming language with loops, conditionals, and type checking.
What I Actually Recommend
For most teams in 2025, I recommend Terraform. Here's why:
- Skills transfer — Even if you're AWS today, Terraform knowledge works everywhere.
- Ecosystem — The module registry, community, and tooling around Terraform is unmatched.
- Future-proofing — Multi-cloud is increasingly common. Having one tool that does everything is valuable.
- Hiring — More engineers know Terraform than CloudFormation. Easier to hire.
That said, if you're a small team, 100% on AWS, and just want to get stuff done—CloudFormation is totally fine. Don't let anyone tell you it's a "wrong" choice.
Pro Tips Regardless of Choice
- Use remote state/backends — Never store Terraform state locally. Use S3 + DynamoDB for locking.
- Modularize early — Break your infrastructure into reusable modules/stacks from day one.
- Version control everything — Infrastructure code belongs in Git, just like application code.
- CI/CD for infrastructure — Run plan/apply through pipelines, not from laptops.
- Tag everything — Consistent tagging makes cost tracking and resource management much easier.
Need Help With Infrastructure as Code?
Whether you're starting fresh with IaC, migrating from one tool to another, or trying to clean up years of accumulated tech debt—we've been there. We've helped teams adopt Terraform, migrate from CloudFormation, and build robust infrastructure pipelines.
Get a free IaC consultation: info@cloudelevate.ai
Tagged with
Ready to elevate your cloud infrastructure?
Get a free consultation with our DevOps experts.