What is the difference between Terraform and CloudFormation?
⚡
Quick Answer
Terraform is cloud-agnostic (multi-provider) with an explicit state file and HCL. CloudFormation is AWS-native, deeply integrated with AWS services, manages state for you, and uses JSON/YAML templates.
Detailed Answer
CloudFormation shines if you are all-in on AWS: no state file to manage, native drift detection, and first-class support for new AWS features. Terraform wins for multi-cloud or mixed estates and has a large module ecosystem, but you own remote state and locking. The choice is usually AWS-only vs multi-cloud.
💡
Interview Tip
Summarize as AWS-native + managed state (CloudFormation) vs multi-cloud + explicit state (Terraform).
terraformcloudformationaws