What if you could build your entire cloud setup with just one command, perfectly every time?
Terraform vs CloudFormation vs Pulumi - When to Use Which
Start learning this pattern below
Jump into concepts and practice - no test required
Imagine setting up a whole city of buildings by hand, brick by brick, without any blueprint or tools.
Every time you want to add a new building or fix one, you have to start over or risk mistakes.
Doing cloud setup manually means clicking through many screens or writing repetitive commands.
This is slow, easy to mess up, and hard to repeat exactly the same way.
It's like trying to build that city without a plan -- you waste time and might break things.
Terraform, CloudFormation, and Pulumi let you write a clear plan for your cloud setup in code.
This plan can be saved, shared, and run again to build or update your cloud safely and quickly.
Click through AWS console to create each resource one by one
terraform apply -auto-approve
You can build, change, and share your cloud setup like a recipe that anyone can follow perfectly every time.
A company launches a new app and needs many servers, databases, and networks.
Using Terraform or Pulumi, they write one code file to create all resources at once, saving weeks of manual work.
Manual cloud setup is slow and error-prone.
Infrastructure as Code tools automate and simplify cloud management.
Terraform, CloudFormation, and Pulumi each offer ways to write and run cloud setup as code.
Practice
Solution
Step 1: Identify AWS-only tool
CloudFormation is the only tool among the options that works exclusively with AWS.Step 2: Check template language
CloudFormation uses JSON or YAML for its templates, unlike Terraform (HCL) or Pulumi (programming languages).Final Answer:
CloudFormation -> Option AQuick Check:
AWS-only + JSON/YAML = CloudFormation [OK]
- Confusing Terraform as AWS-only
- Thinking Pulumi uses JSON/YAML
- Selecting Ansible which is not IaC focused
Solution
Step 1: Identify Pulumi's language style
Pulumi uses real programming languages such as JavaScript, Python, Go, or C# for defining infrastructure.Step 2: Eliminate other options
HCL is Terraform's language, JSON/YAML with AWS is CloudFormation, and shell scripts are not Pulumi's approach.Final Answer:
Uses general-purpose programming languages like JavaScript or Python -> Option AQuick Check:
Pulumi = real programming languages [OK]
- Confusing Pulumi with Terraform's HCL
- Thinking Pulumi uses JSON/YAML
- Assuming Pulumi uses shell scripts
1. Supports AWS, Azure, GCP 2. Uses JSON or YAML 3. Uses HCL 4. Uses programming languages like TypeScript
Solution
Step 1: Match multi-cloud support
Terraform supports multiple clouds like AWS, Azure, and GCP.Step 2: Match language used
Terraform uses HCL, a simple declarative language. JSON/YAML is CloudFormation, programming languages like TypeScript is Pulumi.Final Answer:
Terraform -> Option DQuick Check:
Multi-cloud + HCL = Terraform [OK]
- Choosing Pulumi for HCL language
- Selecting CloudFormation for multi-cloud
- Confusing Chef with IaC tools
Solution
Step 1: Identify the cause of failure
The Pulumi program uses AWS resource names but tries to deploy on Azure, causing incompatibility.Step 2: Understand Pulumi's multi-cloud nature
Pulumi supports multiple clouds but resource names and APIs differ per cloud and must be adjusted accordingly.Final Answer:
Using AWS resource names in a multi-cloud Pulumi program without adjusting for Azure -> Option CQuick Check:
Cloud-specific resource names must match target cloud [OK]
- Thinking Pulumi can't use Python
- Believing Terraform is required for AWS
- Assuming CloudFormation works on Azure
Solution
Step 1: Identify multi-cloud support with TypeScript
Pulumi supports multiple clouds and allows writing infrastructure code in TypeScript, matching the requirement.Step 2: Compare other tools
Terraform supports multi-cloud but uses HCL, not TypeScript. CloudFormation is AWS-only. Ansible is for automation, not primarily IaC with TypeScript.Final Answer:
Pulumi, because it supports multiple clouds and uses real programming languages like TypeScript -> Option BQuick Check:
Multi-cloud + TypeScript = Pulumi [OK]
- Choosing Terraform for TypeScript support
- Selecting CloudFormation for multi-cloud
- Confusing Ansible with IaC tools
