cdktf
Cloud Development Kit for Terraform
What it is and what it does
CDKTF is a library that lets you write infrastructure definitions in Python instead of Terraform's HCL language. It uses familiar programming constructs (classes, functions, variables) to define cloud resources, then synthesizes them into standard Terraform configuration files that you apply with the Terraform CLI. The library depends on constructs, jsii, publication, and typeguard to bridge Python code to Terraform's underlying model.
However, CDKTF is no longer maintained. HashiCorp archived the project on December 10, 2025, stating it did not achieve product-market fit. The codebase remains available on GitHub as read-only, but will receive no updates, security patches, or compatibility fixes. You can continue using it at your own risk, and the project provides a migration command (`cdktf synth --hcl`) to convert existing projects to standard HCL for long-term support.
Use it for:
- Migrate an existing Terraform project to Python code for better IDE support and testing before sunsetting the project.
- Generate HCL from a CDKTF project using `cdktf synth --hcl` to bootstrap a migration to standard Terraform.
- Maintain a legacy CDKTF application in read-only mode if you accept the risk of no future updates.
- Evaluate how programming-language infrastructure-as-code approaches compare to HCL before choosing a long-term tool.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Defines cloud infrastructure using Python code that synthesizes to Terraform configuration, allowing you to manage cloud resources through programming constructs instead of HCL.
No. CDKTF is abandoned and archived as of December 10, 2025 with no further maintenance, updates, or compatibility fixes. If you have an existing CDKTF project, use the built-in migration command to convert to HCL and standard Terraform. For new infrastructure projects, choose an actively maintained tool such as standard Terraform with HCL or an alternative CDK ecosystem aligned with your cloud provider.
Install
cdktf on PyPI
pip
pip install cdktfuv
uv add cdktfpoetry
poetry add cdktfInstalling cdktf
Before you install
Low install friction with a pure Python wheel and four runtime dependencies. However, the project is abandoned as of December 10, 2025 and will receive no further updates, fixes, or compatibility improvements—use only if you accept ongoing maintenance risk.
License in practice
Licensed under MPL-2.0 (copyleft). You may use and modify the code, but derivative works and distributed modifications must remain under the same license. No additional restrictions are applied by HashiCorp.
Quickstart
pip install cdktf
from cdktf import App, TerraformStack
from constructs import Construct
app = App()
stack = TerraformStack(app, "example")
app.synth()
Requires Python 3.9 or later. The Terraform CLI and a Terraform provider for your target cloud platform are needed to apply synthesized configuration.
Verify before relying
- Whether existing CDKTF projects will continue to work with future Terraform or provider releases after December 10, 2025.
- Community fork status and whether maintained alternatives exist for ongoing CDKTF development.
- Compatibility of generated HCL with complex or custom Terraform modules after migration.
Package facts
| License | MPL-2.0 (copyleft) |
| Python support | supports the current Python release (~=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — constructs, jsii, publication, typeguard |
| Maintenance | abandoned — 436 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 449,297/month — #6,596 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cdktf-0.21.0-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
cdktf-cdktf-provider-awsProvides prebuilt Python bindings for the…
copyleft · top 15,000 on PyPI
bc-python-hcl2Parses HCL2 configuration files (such as…
permissive · top 5,000 on PyPI
tfparsetfparse parses and evaluates Terraform HCL…
permissive · top 15,000 on PyPI
python-terraformWraps the Terraform command-line tool, allowing…
permissive · top 15,000 on PyPI
python-hcl2Parses HCL2 configuration files (used by…
permissive · top 5,000 on PyPI
aws-cdk.aws-cloudformationDefines AWS CloudFormation resources…
permissive · top 15,000 on PyPI
terraform-complianceterraform-compliance is a BDD-based test…
permissive · top 15,000 on PyPI
aws-cdk.assetsProvides Python bindings for AWS CDK asset…
permissive · top 15,000 on PyPI
pyhclParses HCL (HashiCorp Configuration Language)…
copyleft · top 5,000 on PyPI
cdk8scdk8s is a framework for defining Kubernetes…
permissive · top 15,000 on PyPI