close
v0.23.3 released—Release notes·Migration guide
Community Fork • 100% Open Source

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.

TypeScript, Python, Java, C#, Go
Both Terraform and OpenTofu support
Backed by Open Constructs Foundation
Placeholder logo — we're open to suggestions!
CDKTN
CDKTF is deprecated

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. 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. 2. Update your imports

    Replace from "cdktf" with from "cdktn". Construct IDs and synthesized logical IDs don't change, so nothing gets replaced.

  3. 3. Synth and diff

    Run cdktn synth and cdktn diff to 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 diff
Read the CDKTF migration guide

Get 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-cli

Requires Node.js 22.19+ and Terraform or OpenTofu on your PATH.

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/mcp

Claude Code shown. The docs MCP server at https://cdktn.io/docs/mcp works with any client that supports streamable HTTP; read-only, no auth.

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.

1

Stable Provider Bindings

Pre-built, tested, and maintained provider bindings for official providers. Security updates. Follow upstream provider releases.

2

Easy Migration from CDKTF

Already using CDKTF? Switching should be effortless. Clear docs, migration guides, and a community ready to help you move over.

3

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

AWS CDK
CDK for Kubernetes (cdk8s)
Projen
CDK Terrain

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 more

Mintlify 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 more

Depot.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 more

1Password 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 more

Questions?

Common stuff people ask about

Overview

What is CDK Terrain?›
CDK Terrain (cdktn - cdktn.io) is a community-driven continuation of the Cloud Development Kit for Terraform (CDKTF). It allows developers to define Terraform infrastructure using familiar programming languages like TypeScript and Python, synthesizing that code into standard Terraform JSON configuration.
Why the name "CDK Terrain"?›
The name "CDK Terrain" reflects the project's purpose of helping developers shape their infrastructure landscape. The abbreviation "cdktn" follows the established pattern of other CDK projects (cdk8s, cdktf) while establishing a distinct identity for the community-driven project.
What is the relationship between CDK Terrain and CDKTF?›
CDK Terrain is a community-driven fork of CDKTF, created with HashiCorp's blessing following their deprecation announcement. The project preserves the original codebase and commit history while enabling continued development under the Open Construct Foundation's stewardship.
Will HashiCorp be involved in CDK Terrain?›
HashiCorp has given their blessing for the community to fork CDKTF through this initiative. While HashiCorp is not directly involved in CDK Terrain's ongoing development, the foundation appreciates their support in enabling this community-driven continuation.

Migrating from CDKTF

Is CDKTF (CDK for Terraform) deprecated?›
Yes. HashiCorp deprecated CDK for Terraform (CDKTF) and archived the terraform-cdk repository. CDK Terrain (CDKTN) is the community-maintained continuation, forked with HashiCorp's blessing and stewarded by the Open Construct Foundation.
What replaces CDKTF?›
CDK Terrain (CDKTN) is the drop-in successor to CDKTF. It keeps the same APIs, constructs and workflow, and supports TypeScript, Python, Java, C# and Go with both Terraform and OpenTofu.
How do I migrate from CDKTF to CDK Terrain?›
Swap the packages (cdktf → cdktn, cdktf-cli → cdktn-cli, @cdktf/provider-* → @cdktn/provider-*), update your imports from "cdktf" to "cdktn", and run cdktn synth instead of cdktf synth. Most projects migrate in minutes; the migration guide covers every language.
Will migrating to CDKTN change my Terraform state or recreate resources?›
No. cdktf.json, the cdktf.out directory, CDKTF_* environment variables and internal logical IDs are unchanged, so synthesized resources keep their addresses and your existing Terraform state keeps working. Run cdktn diff after migrating to confirm there are no changes.
Are prebuilt providers available for CDK Terrain?›
Yes. Prebuilt providers are published as @cdktn/provider-* on npm (and to PyPI and Go modules), and cdktn get generates bindings for any Terraform or OpenTofu provider or module.

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?›
Yes, CDK Terrain is designed as a drop-in replacement for CDKTF. Existing projects should work with minimal changes, primarily updating package names and imports. Detailed migration guides will be provided to assist users in transitioning their codebases.
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?›
CDK Terrain will support all Terraform providers leveraging provider generation tooling that CDKTF offered. An initial set of pre-built provider packages are published re-using a similar infrastructure to what Hashicorp offered. These repositories are managed by the cdktn-repository-manager and are actively being worked on. The community will maintain popular provider packages, and users can continue to generate bindings for any Terraform provider.
What programming languages will be supported?›
Initial releases will support TypeScript and Python, the two most widely used languages in the CDKTF community. Support for additional languages (Java, C#, Go) will be added based on community demand and contributor availability.
How will CDK Terrain be licensed?›
CDK Terrain will be licensed under the Mozilla Public License 2.0 (MPL 2.0), the same license used by the original CDKTF project. This ensures continuity for existing users and maintains the project's open-source nature.
What is the development roadmap?›
The immediate focus is on establishing the project infrastructure, forming the maintainer group, and releasing an initial version that ensures compatibility with existing CDKTF projects. Subsequent releases will address bug fixes, security updates, and community-requested features. A detailed roadmap will be published once the maintainer group is established.

Getting Started

Who will maintain CDK Terrain?›
The Open Construct Foundation is actively forming a maintainer group consisting of experienced CDKTF users and contributors from the community. Maintainers will be selected based on their expertise, commitment, and alignment with the project's goals. The foundation provides oversight to ensure consistent governance and quality standards.
How can I migrate my existing CDKTF project to CDK Terrain?›
Migration will primarily involve updating package names and imports in your project. The CDK Terrain documentation will include step-by-step migration guides for each supported language. The goal is to make migration as straightforward as possible while preserving your existing infrastructure code.
How can developers contribute to CDK Terrain?›
Developers can contribute by joining the community and help realise the project roadmap through collabarative and coordinated efforst. This will be crucial for establishing the new foundations for the CDK Terrain project. Join the #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.