Terraform interview question · Most asked
Compare Terraform with CloudFormation, CDK and Pulumi.
Summary
Terraform is multi-cloud and multi-service with a huge provider ecosystem and HCL configuration; CloudFormation is AWS's native IaC service (state managed by AWS, deep AWS integration, AWS-only); AWS CDK and CDK for Terraform let you write infrastructure in programming languages that synthesise to CloudFormation or Terraform; Pulumi uses general-purpose languages directly with its own engine and state.
Longer Answer
Choose Terraform/OpenTofu for multi-cloud or SaaS providers (Datadog, GitHub, Cloudflare) and a large hiring pool; CloudFormation/CDK for AWS-only shops that want AWS-managed state and same-day support for new services; Pulumi or CDK when teams strongly prefer real programming languages for abstraction and testing. Consistency across the organisation often matters more than which tool is slightly better.
Key Points
- Terraform: multi-cloud ecosystem.
- CloudFormation: AWS-native, managed state.
- CDK/Pulumi: programming languages.
- Consistency matters most.
More most-asked Terraform questions
- How do you handle secrets in Terraform?
- How would you run Terraform in CI/CD?
- What is Terraform state, why is it needed, and where should it be stored?
- count or for_each: when do you use each?
- Walk through terraform init, plan and apply. What does each do?
- What is Terraform, and how does it work at a high level?
- What are Terraform modules, and how do you design good ones?
- A terraform plan wants to destroy and recreate a database. What do you do?