SaveMyCert
Cloud basics

Terraform vs CloudFormation: which should you learn?

Terraform and AWS CloudFormation are both infrastructure-as-code tools, but Terraform is multi-cloud and provider-agnostic while CloudFormation is AWS-native — the right choice depends largely on whether you work across multiple clouds or exclusively on AWS. Both let you define infrastructure in code instead of clicking through a console, and both track what they have created so they can update or remove it later. Where they diverge is scope, language and who manages the bookkeeping. This guide compares them directly, fairly, and points to where each fits in certification study.

What Terraform is

Terraform is HashiCorp’s infrastructure-as-code tool, using its own declarative language, HCL, to describe the infrastructure you want. It works across AWS, Azure, Google Cloud and a wide range of other providers using the same workflow and syntax, and it tracks a state file that records what it has already created, so it can work out what needs to change on a later run. Our what is Terraform and what is infrastructure as code explainers cover both the tool and the broader discipline in more depth; this comparison assumes that grounding.

What CloudFormation is

AWS CloudFormation is AWS’s own native infrastructure-as-code service, using JSON or YAML templates to describe AWS resources. It is deeply integrated with the rest of AWS — new AWS services and features typically gain CloudFormation support at or near their own launch — and unlike Terraform, AWS manages the state itself: you are not responsible for storing or protecting a separate state file, because CloudFormation tracks what it has provisioned as part of the service. There is no separate charge for CloudFormation itself; you pay only for the AWS resources it creates.

The key differences

Set side by side, the two tools separate along a few clear lines:

  • Scope — Terraform is multi-cloud, working the same way across AWS, Azure, Google Cloud and beyond; CloudFormation is AWS-only.
  • Language — Terraform uses HCL, its own configuration language; CloudFormation uses JSON or YAML templates.
  • State management — with Terraform, you are responsible for storing and protecting the state file; with CloudFormation, AWS manages state for you as part of the service.
  • Ecosystem — Terraform has a large third-party provider ecosystem spanning many platforms and services; CloudFormation offers first-party AWS integration, often supporting new AWS features from day one.

How to choose

If you are all-in on AWS and want the tightest possible integration with the platform — including near-immediate support for newly released AWS features — CloudFormation is a natural fit, and it removes the operational burden of managing state yourself. If you work across multiple cloud providers, or simply want one tool and one language to learn regardless of which provider a given workload sits on, Terraform is the better fit; our should you learn more than one cloud explainer covers the broader question of multi-cloud skills that this decision often sits alongside.

Both are widely used

Neither tool is a fringe choice, and the decision between them in a given organisation is often more about existing platform commitments and team preference than a clear technical winner. A team already deeply invested in AWS, with no near-term multi-cloud plans, loses little by staying native with CloudFormation; a team managing infrastructure across providers, or one that simply values a consistent tool and language everywhere, tends to gravitate to Terraform. Both approaches are common in production, and switching between them is a real but manageable undertaking rather than a trivial one.

The certification angle

HashiCorp’s Terraform Associate certification validates Terraform specifically — its workflow, state management and core language concepts — for anyone whose infrastructure-as-code work centres on it. CloudFormation is not the subject of a standalone AWS certification in the same way, but it appears as part of the broader infrastructure and deployment knowledge tested across AWS certifications such as the Solutions Architect and CloudOps Engineer Associate exams.

Ready to start studying — free?

Original practice questions, timed mock exams and revision notes. No card, nothing to pay.

Jump straight into an exam
SAA-C03SOA-C03Terraform 004

Questions, answered

Terraform is a multi-cloud infrastructure-as-code tool that works the same way across AWS, Azure, Google Cloud and other providers, using its own HCL language; CloudFormation is AWS’s native infrastructure-as-code service, using JSON or YAML templates and working only with AWS.

Keep reading

Cloud basics
What is a bastion host? The controlled way into a private network
Cloud basics
What is a container registry? Where container images live
Cloud basics
What is a data pipeline? Moving data from source to use
Cloud basics
What is a hypervisor? Type 1 vs Type 2 explained