Skip to main content

What's the Difference Between AWS CDK and AWS CloudFormation?

Compare AWS CDK and AWS CloudFormation side by side — features, pricing, and ideal use cases to help you choose the right product.

Compare side-by-side

Comparisons
AWS CDK
AWS CloudFormation
Category

Developer Tools, Infrastructure as code

Management & Governance, Infrastructure as code

Description

Infrastructure-as-code framework to model cloud resources

Infrastructure-as-code service for AWS resources

Best for
  • Infrastructure as code
  • Application scaffolding
  • Reusable constructs
  • Multi-stack deployments
  • Infrastructure as code
  • Environment replication
  • Disaster recovery
  • CI/CD
Key features
  • Multiple languages
  • Constructs library
  • CDK Pipelines
  • Asset bundling
  • Testing support
  • JSON/YAML templates
  • Stack sets
  • Drift detection
  • Change sets
  • Custom resources
Pricing model

No additional charge; pay for resources created

No additional charge; pay for resources created

Free tier

Yes

Yes

Expert take

“CDK lets developers define infrastructure in the same language as their application, with IDE autocomplete and type safety. L2 and L3 constructs encode AWS best practices (encryption, logging, least-privilege) by default. CDK Pipelines builds self-mutating CI/CD that deploys both app and infra changes.”
— Gary McLean, re:Post Top Contributor [profile]

“CloudFormation is the native IaC tool that supports every AWS resource on day one of launch. Use Change Sets to preview changes before applying, Drift Detection to find manual modifications, and StackSets to deploy the same template across hundreds of accounts and regions.”
— Oleksii Bebych, re:Post Top Contributor [profile]

Product page

When to use AWS CDK or AWS CloudFormation

Use AWS CDK when:

  • Infrastructure as code
  • Application scaffolding
  • Reusable constructs
  • Multi-stack deployments

Learn more about AWS CDK »

Use AWS CloudFormation when:

  • Infrastructure as code
  • Environment replication
  • Disaster recovery
  • CI/CD

Learn more about AWS CloudFormation »

AWS product comparisons

Did you find what you were looking for today?

Let us know so we can improve the quality of the content on our pages