Define Infrastructure with Code
CDK Terrain is the community-driven successor to CDKTF (CDK for Terraform), which HashiCorp has deprecated. Write infrastructure in TypeScript, Python, Java, and more. Works with both Terraform and OpenTofu. Made by developers, for developers.
Migrating from CDKTF? It takes minutes.
HashiCorp has deprecated CDK for Terraform (CDKTF) and archived its repository. CDK Terrain is the drop-in continuation: same APIs, same constructs, same cdktf.json - just new package names. Your Terraform state and resource addresses stay exactly as they are.
1. Swap the packages
cdktf→cdktn,cdktf-cli→cdktn-cli, and@cdktf/provider-*→@cdktn/provider-*. Python, Go, Java and C# packages are renamed the same way.2. Update your imports
Replace
from "cdktf"withfrom "cdktn". Construct IDs and synthesized logical IDs don't change, so nothing gets replaced.3. Synth and diff
Run
cdktn synthandcdktn diffto confirm there are no changes, then keep deploying with Terraform or OpenTofu as before.
# package.json
- "cdktf": "^0.21.0",
+ "cdktn": "^0.24.0",
- "@cdktf/provider-aws": "^21.0.0",
+ "@cdktn/provider-aws": "^25.0.0",
# main.ts
- import { App, TerraformStack } from "cdktf";
+ import { App, TerraformStack } from "cdktn";
# shell
$ npm install -g cdktn-cli
$ cdktn synth && cdktn diffRead the CDKTF migration guideGet started
Install the CLI, or point your AI coding agent at the docs so it answers from current CDK Terrain documentation instead of stale CDKTF knowledge.
Install the CLI
npm install -g cdktn-cliRequires Node.js 22.19+ and Terraform or OpenTofu on your PATH.
brew install open-constructs/tap/cdktnComing from the cdktf formula? Run brew uninstall cdktf first. Bring your own Terraform or OpenTofu (brew install opentofu).
Both install the cdktn-cli package, which provides the cdktn command (init, get, synth, diff, deploy). See the install guide and the CLI reference.
Use with AI agents
claude mcp add --transport http cdktn-terraform-cdk-docs https://cdktn.io/docs/mcpClaude Code shown. The docs MCP server at https://cdktn.io/docs/mcp works with any client that supports streamable HTTP; read-only, no auth.
npx skills add https://cdktn.io/docsAdds the CDK Terrain agent skill (skill.md, generated from these docs) to any skills-aware agent.
Use both: the skill tells the agent when to reach for CDK Terrain, the MCP server gives it live doc lookups. Agents without either can read the llms.txt index. Setup for Cursor, VS Code and others: Use CDKTN with AI agents.
Why CDK Terrain?
CDKTF is amazing, but it needed a home where the community could take the lead. CDK Terrain is that fork - 100% open source, no corporate strings attached. We're focused on long-term support, security, and listening to what the community actually needs.
Infrastructure as Real Code
Use the language you already know - TypeScript, Python, Java, C#, Go - and let your code synthesize into perfect Terraform configs.
Terraform & OpenTofu
First-class support for both Terraform and OpenTofu. You pick the tool. We support them equally. That's what open source is about.
Community Owned
Everyone gets a voice. Contributions matter. Issues get addressed. This is your project as much as ours.
What We're Building
Here's what matters to us. No corporate roadmap vaporware - just real problems we're solving.
Stable Provider Bindings
Pre-built, tested, and maintained provider bindings for official providers. Security updates. Follow upstream provider releases.
Easy Migration from CDKTF
Already using CDKTF? Switching should be effortless. Clear docs, migration guides, and a community ready to help you move over.
Stay Current with Terraform & OpenTofu
New features land in Terraform and OpenTofu? We aim to ensure CDK Terrain follows both. Security issues? We aim to provide automated updates and accept community contributions.
Part of the Open Constructs Foundation
CDK Terrain is hosted by the Open Constructs Foundation, a non-profit made up of people who actually built AWS CDK and CDKTF. We aim to gather developers to make sure the CDK ecosystem stays independent and community-driven.
The OCF connects developers across AWS CDK, cdk8s, projen, and now CDK Terrain. One community. Different tools. Same values.
The CDK Family
One foundation. Many projects. All open source.
Open Source Supporters
CDK Terrain is a community-maintained open source project. The following companies support the project by providing critical infrastructure and tooling through their open source programs.
Sentry provides error tracking and observability for CDK Terrain through its open source program, helping us detect regressions, debug issues, and maintain a high-quality developer experience as the project evolves.
Learn moreMintlify supports CDK Terrain documentation with its open source plan, enabling us to deliver modern, searchable, and LLM-native docs for both users and contributors. Mintlify also facilitates a community maintained knowledge base.
Learn moreDepot.dev provides CI infrastructure through its open source program, allowing us to run large-scale provider generation and test workflows efficiently as part of our GitHub Actions pipelines.
Learn more1Password supports CDK Terrain through its open source program, giving the core maintainer team a secure way to manage long-lived secrets and credentials - essential for frequent token rotation in a time of frequent supply-chain attacks.
Learn moreQuestions?
Common stuff people ask about
Overview
What is CDK Terrain?›
Why the name "CDK Terrain"?›
What is the relationship between CDK Terrain and CDKTF?›
Will HashiCorp be involved in CDK Terrain?›
Migrating from CDKTF
Is CDKTF (CDK for Terraform) deprecated?›
What replaces CDKTF?›
How do I migrate from CDKTF to CDK Terrain?›
Will migrating to CDKTN change my Terraform state or recreate resources?›
Are prebuilt providers available for CDK Terrain?›
Compatibility
Does CDK Terrain support OpenTofu?›
Yes. CDK Terrain is designed to remain compatible with both Terraform and OpenTofu.
CDK Terrain synthesizes standard Terraform configuration, allowing users to choose their preferred execution engine. At present, users can run CDK Terrain–generated output with either Terraform or OpenTofu without special configuration or feature gaps compared to the last CDKTF release.
One of the long-term goals of the CDK Terrain fork is to remove historical constraints that limited evolution in the original project, including slow adoption of newer Terraform features. Decisions about which features, versions, or execution engines to support will be guided by community needs, maintainer capacity, and ecosystem stability rather than fixed assumptions.
The Open Construct Foundation intends to remain pragmatic and transparent in these decisions, with the goal of supporting both ecosystems where it is feasible and sustainable to do so.
CDK Terrain aims to remain execution-engine agnostic, enabling users to choose between Terraform and OpenTofu based on their operational and licensing preferences.
Is CDK Terrain compatible with existing CDKTF projects?›
What is the relationship between CDK Terrain and OpenTofu?›
OpenTofu is an independent, CNCF-hosted project focused on providing an open-source, Terraform-compatible CLI and ecosystem. CDK Terrain is governed by the Open Construct Foundation and is developed independently.
The two projects are not formally affiliated. However, the relationship is open and constructive. The OpenTofu team has offered its guidance and expertise and is a helpful resource for discussions around compatibility, workflows, and ecosystem considerations.
Any interaction between CDK Terrain and OpenTofu is informal, community-driven, and non-exclusive. There are no commitments around feature prioritization, roadmap alignment, or long-term integration on either side.
Technical
What Terraform providers will be supported?›
What programming languages will be supported?›
How will CDK Terrain be licensed?›
What is the development roadmap?›
Getting Started
Who will maintain CDK Terrain?›
How can I migrate my existing CDKTF project to CDK Terrain?›
How can developers contribute to CDK Terrain?›
#cdk-terrain channel on the cdk.dev Slack workspace to get started.Ready to Shape Infrastructure as Code?
This is an open source project, which means it's yours too. Report bugs, share ideas, write code, improve docs. Every contribution matters.
