Your organization is debating whether to use CloudFormation, Terraform, or AWS CDK for infrastructure management across 50 AWS accounts. What are the key trade-offs, and when would you choose each?
Quick Answer
CloudFormation for AWS-only, compliance-heavy environments with native service integration; Terraform for multi-cloud or multi-provider workflows with mature state management; CDK when developer teams want to use programming languages while getting CloudFormation's native AWS integration under the hood.
Detailed Answer
CloudFormation Strengths
CloudFormation is AWS's native IaC service with zero additional cost, automatic state management (no separate state file), deep integration with AWS services (often supports new services on launch day), and native support for features like StackSets (multi-account deployment), drift detection, and Change Sets. It operates within AWS's control plane, meaning IAM policies control who can deploy what. For regulated industries, CloudFormation's native integration with AWS Config, CloudTrail, and Service Catalog is a significant advantage.
Terraform Strengths
Terraform supports multi-cloud (AWS, Azure, GCP, Kubernetes) and multi-provider (Datadog, PagerDuty, GitHub) workflows with a single tool. Its plan-apply workflow is more explicit than CloudFormation's change sets. The module registry provides reusable patterns. State management via remote backends (S3, Terraform Cloud) is mature. Terraform's provider ecosystem is broader - you can manage DNS, monitoring, CI/CD, and cloud resources in one codebase.
AWS CDK Strengths
CDK lets developers write infrastructure in TypeScript, Python, Java, Go, or C# and synthesizes it to CloudFormation templates. This gives you real programming language features (loops, conditionals, type checking, IDE support) while retaining CloudFormation's native deployment engine. CDK constructs provide higher-level abstractions than raw CloudFormation, and the construct library is growing rapidly.
Decision Framework
Choose CloudFormation when you're AWS-only, need native compliance features, and your team is comfortable with YAML/JSON. Choose Terraform when you're multi-cloud, need to manage non-AWS resources, or want the plan-apply workflow. Choose CDK when your team has strong programming skills and you want CloudFormation's native benefits with better developer experience. Avoid mixing all three in one organization without clear boundaries.