skillfed

cdktf

Cloud Development Kit for Terraform

cdktf v0.21.0 449.3K downloads/30d#6,596 on PyPI5,075
Copyleft license MPL-2.0 Abandoned released

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 cdktf

uv

uv add cdktf

poetry

poetry add cdktf

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9Typing :: Typed

Tags

infrastructure as code pythonterraform programmatic definitioncloud infrastructure code generationterraform alternative to hclpython terraform provisioningcdk terraforminfrastructure automation python
infrastructure-as-codeterraformarchived

More Build Tools packages