DEV Community

IT Defined
IT Defined

Posted on

Terraform vs AWS CloudFormation in 2026: Which One Should You Actually Learn?

The short answer (because I know you're scrolling)

Learn Terraform. If you're a beginner picking your first IaC tool in 2026, learn Terraform. CloudFormation is fine, it's not bad, but the job market and the ecosystem have decided. Terraform won.

If you're already at a company using CloudFormation, you don't need to migrate. Stay where you are. Both tools do the same job, just differently.

The rest of this post is the long version with the receipts.

Syntax — HCL vs JSON/YAML

Here's a Terraform resource for an S3 bucket:

resource "aws_s3_bucket" "logs" {
  bucket = "my-app-logs"
  tags = {
    Environment = "prod"
    Owner       = "devops-team"
  }
}
Enter fullscreen mode Exit fullscreen mode

Same thing in CloudFormation YAML:

Resources:
  LogsBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my-app-logs
      Tags:
        - Key: Environment
          Value: prod
        - Key: Owner
          Value: devops-team
Enter fullscreen mode Exit fullscreen mode

Both are fine. HCL is friendlier once you're used to it. CloudFormation also supports JSON, but please don't — trailing commas, no comments, every developer maintaining it will hate you.

State management — where Terraform gets tricky

CloudFormation manages state for you. AWS knows what it created. There's no state file. Delete a stack, AWS deletes the resources. Simple.

Terraform keeps a state file. Local JSON file by default. In production, you put it in S3 with state locking via DynamoDB. Lose this file, Terraform forgets your infrastructure exists, even though AWS still has the resources.

Sounds bad. It is bad, the first time you mess it up. But there's a tradeoff — Terraform's state model is what makes it portable across clouds.

Practical advice: if you go with Terraform, set up remote state in S3 with DynamoDB locking from day one. Never use local state for anything beyond personal experiments.

Multi-cloud — the most misunderstood argument

People say "learn Terraform because it's multi-cloud." Then they only ever use it for AWS.

Real talk: most Bangalore companies are AWS-only. Or AWS plus a tiny bit of GCP for BigQuery. The multi-cloud dream is real for a small number of large enterprises.

But here's the thing — even if you're AWS-only, Terraform's provider model means you can also manage GitHub repos, Cloudflare DNS, Datadog dashboards, PagerDuty schedules, and a hundred other things in the same codebase. CloudFormation can't.

That's the actual advantage in practice — not multi-cloud, but multi-vendor.

What the job market actually says

I run a training institute, so I track what JD requirements look like. As of early 2026, looking at LinkedIn and Naukri postings for Bangalore DevOps roles:

  • Terraform mentioned: ~75-80% of postings
  • CloudFormation mentioned: ~30-35%
  • Pulumi or CDK mentioned: <5%

Most jobs that mention CloudFormation also mention Terraform. Few jobs require only CloudFormation.

When CloudFormation actually wins

  • Pure AWS shops with strong AWS Organizations/Control Tower setups
  • Compliance-heavy environments where you want AWS-native audit trails
  • Teams already invested in AWS CDK
  • Lambda-heavy serverless apps — SAM is genuinely simpler

What we teach

Honestly? We teach both, but we go deeper on Terraform. Roughly 70/30 split.

If you only have time for one — go Terraform.

Full version with module patterns, state strategies, and 8 common interview questions on itdefined.org.

Top comments (0)