Use the AWS CDK if you build only on AWS and want to define infrastructure in a programming language such as TypeScript or Python; it deploys through AWS CloudFormation. Use Terraform if you work across clouds or SaaS tools, because its providers reach almost any platform with an API and its configuration files read the same everywhere. If you hoped for both through CDK for Terraform, note HashiCorp has deprecated it.
I read the AWS CDK v2 Developer Guide and HashiCorp's Terraform introduction and CDK for Terraform pages. They're a common shortlist, and one change at HashiCorp settles a popular middle-ground plan.
AWS CDK and Terraform compared
| AWS CDK | Terraform | |
|---|---|---|
| In one line | Open source framework for defining AWS infrastructure in code | Infrastructure as code tool for cloud and on-prem resources |
| How you write it | TypeScript, JavaScript, Python, Java, C#/.Net or Go | Human-readable configuration files |
| How it deploys | Synthesises to AWS CloudFormation | Write, Plan and Apply against provider APIs |
| Reach | AWS services | Thousands of providers on the Terraform Registry |
| Reusable pieces | Constructs from the Construct Library | Configuration files you can version, reuse and share |
| Managed option | Runs through your AWS account | HCP Terraform and Terraform Enterprise |
| Free option (as of October 2026) | Yes, the AWS CDK is open source | Not stated on the pages I read |
Why teams pick the AWS CDK
AWS describes the CDK as an open source framework for defining cloud infrastructure in code and provisioning it through CloudFormation. You get a Construct Library of reusable, pre-written building blocks and a Toolkit with a CLI for synthesis and deployment. Because you're writing in a programming language, you get its expressive power, and AWS says you can keep infrastructure, application code and configuration all in one place.
If you're on old code, note that CDK v1 ended support on June 1, 2023, so new work belongs on v2.
Why teams pick Terraform
HashiCorp's introduction says Terraform manages low-level pieces like compute, storage and networking as well as DNS entries and SaaS features, through providers for virtually any platform with an API. The Terraform Registry lists thousands of them, from AWS, Azure and Google Cloud to Kubernetes, GitHub and Datadog. Its workflow is easy to explain to a non-engineer: write the configuration, review the plan of what will change, then apply it.
That plan step is useful for anyone who has to sign off changes. Before anything changes, Terraform shows what it'll create, update or destroy, and on approval it carries out the changes in the right order, respecting dependencies between resources. HashiCorp's get-started tutorials cover AWS, Azure, Google Cloud, Oracle Cloud Infrastructure and Docker, so it's easy to try on whichever platform you already use.
The CDK for Terraform news
For a while, CDK for Terraform let you write Terraform in a programming language, which looked like a handy middle ground. HashiCorp's own page now says CDKTF has been deprecated since December 10, 2025, and that it no longer supports or maintains it. If a tutorial suggests CDKTF, treat it as out of date.
Before you commit to Terraform, I'd suggest reading my explainer on whether Terraform is free.
Choosing in four steps
- List every platform you'll manage. Only AWS? The CDK fits. Several clouds or SaaS tools? Terraform.
- Ask who writes the infrastructure. If your developers already work in TypeScript or Python, the CDK keeps them in that language.
- Check how you'll review changes. Terraform's plan step makes approvals simple to explain.
- Don't start new work on CDKTF; pick one of the two tools directly.
For related reading, see this comparison of AWS CloudFront and BunnyCDN and this guide to finding remote DevOps talent if you need someone to run it.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
My advice on CDK or Terraform
If your whole stack sits on AWS and your developers are comfortable in TypeScript or Python, I'd use the AWS CDK and keep infrastructure in the same language as the app. If you use more than one cloud, or want DNS, monitoring and SaaS settings managed the same way, Terraform is the safer long-term choice. And skip CDK for Terraform for anything new, since HashiCorp has stopped maintaining it.
Do you make a cloud, DevOps or infrastructure tool? Tool makers can ask to be considered for a featured place in comparisons like this one.
Frequently asked questions
Is CDK for Terraform still supported?
No. HashiCorp's page says CDKTF has been deprecated since December 10, 2025 and is no longer supported or maintained.
Which languages does the AWS CDK support?
TypeScript, JavaScript, Python, Java, C#/.Net and Go, according to the AWS CDK v2 Developer Guide.
Does the AWS CDK use CloudFormation?
Yes. AWS says you deploy CDK applications through AWS CloudFormation to provision or update resources.
Can Terraform manage more than one cloud?
Yes. Terraform works through providers, and the Terraform Registry lists thousands, including AWS, Azure and Google Cloud.
What are Terraform's three workflow stages?
Write, Plan and Apply: you define resources, review an execution plan, then apply the changes on approval.