{"id":5589,"library":"cdktf","title":"Cloud Development Kit for Terraform (CDKTF)","description":"The Cloud Development Kit for Terraform (CDKTF) allowed developers to define and provision infrastructure using familiar programming languages like Python, instead of HashiCorp Configuration Language (HCL). It provided access to the entire Terraform ecosystem, leveraging existing tooling for testing and dependency management. As of December 10, 2025, HashiCorp has officially deprecated CDKTF, ceasing maintenance and development. The project repository is archived, and no further updates, fixes, or improvements (including compatibility updates) will be made.","status":"deprecated","version":"0.21.0","language":"en","source_language":"en","source_url":"https://github.com/hashicorp/terraform-cdk.git","tags":["IaC","Terraform","Cloud Development Kit","Infrastructure as Code","Python","Deprecated"],"install":[{"cmd":"npm install --global cdktf-cli@latest","lang":"bash","label":"Install CDKTF CLI (requires Node.js)"},{"cmd":"pip install cdktf","lang":"bash","label":"Install CDKTF Python library"},{"cmd":"pip install cdktf-cdktf-provider-aws","lang":"bash","label":"Install an example provider (e.g., AWS)"}],"dependencies":[{"reason":"Required for running the Python application.","package":"python","version":">=3.9"},{"reason":"Required for the `cdktf-cli`.","package":"Node.js","version":">=16.0.0","optional":false},{"reason":"Package manager for `cdktf-cli`.","package":"npm","version":">=8.0.0","optional":false},{"reason":"CDKTF synthesizes to Terraform HCL, requiring the Terraform CLI for plan/apply operations.","package":"Terraform CLI","version":">=1.0.0","optional":false}],"imports":[{"note":"Represents the CDKTF application.","symbol":"App","correct":"from cdktf import App"},{"note":"The base class for defining a stack of Terraform resources.","symbol":"TerraformStack","correct":"from cdktf import TerraformStack"},{"note":"Base class for all constructs, shared with AWS CDK.","symbol":"Construct","correct":"from constructs import Construct"},{"note":"Provider import for AWS. Provider imports generally follow 'cdktf_cdktf_provider_<provider_name>.provider'.","symbol":"AwsProvider","correct":"from cdktf_cdktf_provider_aws.provider import AwsProvider"}],"quickstart":{"code":"import os\nfrom constructs import Construct\nfrom cdktf import App, TerraformStack, TerraformOutput\nfrom cdktf_cdktf_provider_aws.provider import AwsProvider\nfrom cdktf_cdktf_provider_aws.s3 import S3Bucket\n\nclass MyStack(TerraformStack):\n    def __init__(self, scope: Construct, id: str):\n        super().__init__(scope, id)\n\n        AwsProvider(self, 'Aws', region=os.environ.get('AWS_REGION', 'us-east-1'))\n\n        bucket = S3Bucket(self, 'MyBucket',\n            bucket_prefix=\"my-unique-cdktf-bucket-\",\n            tags={\n                \"Environment\": \"Development\",\n                \"ManagedBy\": \"CDKTF\"\n            }\n        )\n\n        TerraformOutput(self, 'bucket_name', value=bucket.id)\n\n\napp = App()\nMyStack(app, 'my-cdktf-aws-stack')\napp.synth()","lang":"python","description":"This quickstart defines an AWS S3 bucket. First, initialize a new CDKTF project with `cdktf init --template=python --providers=aws` in an empty directory. Then, replace the content of `main.py` with the code above. Ensure AWS credentials and default region are configured (e.g., via environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`). Run `cdktf get` to generate provider bindings, then `cdktf deploy` to provision the bucket."},"warnings":[{"fix":"HashiCorp recommends migrating to standard Terraform HCL or AWS CDK if your infrastructure is tightly integrated with AWS CDK. Community forks may emerge, but continued use of CDKTF will be at your own risk.","message":"CDKTF is officially deprecated as of December 10, 2025. HashiCorp will no longer maintain or develop the project, and no further updates, fixes, or compatibility changes will be provided.","severity":"breaking","affected_versions":"All versions, effective from 0.21.0 onwards."},{"fix":"Always consult the GitHub CHANGELOG and upgrade guides (available on the HashiCorp Developer site) for each specific version you are upgrading to. It's recommended to upgrade frequently in small steps.","message":"Prior to reaching version 1.0, CDKTF followed semantic versioning where even minor version bumps could introduce breaking changes to APIs, generated provider bindings, and the synthesis process.","severity":"breaking","affected_versions":"< 1.0.0"},{"fix":"Update provider import statements to reflect the nested `provider` module. For example, `from cdktf_cdktf_provider_aws.provider import AwsProvider`.","message":"Provider import paths changed significantly in version 0.13. Previously, providers might be imported directly from `cdktf_cdktf_provider_<provider_name>`. The correct pattern now is typically `from cdktf_cdktf_provider_<provider_name>.provider import <ProviderName>`.","severity":"gotcha","affected_versions":"< 0.13.0"},{"fix":"Ensure that your globally installed `cdktf-cli` (`npm install --global cdktf-cli@latest`) and the `cdktf` Python library (`pip install cdktf`) are kept in sync, ideally running the same version number.","message":"Mismatched versions between the `cdktf-cli` and the `cdktf` Python library can lead to subtle and confusing errors during synthesis or deployment.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always run `cdktf get` after changing provider configurations or installing new provider bindings to ensure your project has the latest generated classes.","message":"After adding or modifying Terraform providers/modules in `cdktf.json` or installing new provider Python packages, you must run `cdktf get`. This command generates the necessary CDK Constructs for Terraform providers and modules within your project.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}