CDK for Terraform
This experimental repository contains software which is still being developed and in the alpha testing stage. It is not ready for production use.
CDK (Cloud Development Kit) for Terraform allows developers to use familiar programming languages to define cloud infrastructure and provision it through HashiCorp Terraform.
CDK for Terraform apps are written in one of the supported programming languages and can leverage the entire ecosystem of Terraform modules and providers. The application synthesizes Terraform configuration in JSON. Terraform or the CDK for Terraform can then be used to deploy the application.
The CDK for Terraform project includes two packages:
- cdktf-cli - A CLI that allows users to run commands to initialize, import, and synthesize CDK for Terraform applications.
- cdktf - A library for defining Terraform resources using programming constructs.
The project currently supports TypeScript, Python, Java, and C#.
Choose a language:
Hands-on: Try the tutorials in the CDK for Terraform collection on HashiCorp Learn.
Please note: Support for Golang is at an experimental state. In the CDK for Terraform and in the upstream library JSII which powers the support for the supported languages.
⚠️High memory usage: the provider generation currently needs ~6 GB of memory. Hence the maximum for Node.js is currently set to 8GB
- google cloud kubernetes engine + kubernetes
- Install and run a quick start tutorial at HashiCorp Learn
- Learn how to use any module or provider with the CDK for Terraform. You can find all modules and providers in the Terraform Registry.
- Explore the CDK for Terraform CLI.
- Defining Terraform outputs.
- Using Terraform remote backend.
- Using the CDK for Terraform escape hatch.
- Using the CDK for Terraform tokens.
- Using Terraform data sources.
- Using Terraform variables.
- Synthesizing Terraform configuration using CDK for Terraform synthesize command.
- Project telemetry.
- Defining Terraform locals.
- Handling breaking changes with feature flags.
- Writing own remote templates for init.
- Using assets to transfer files into the Terraform context.
Contributing and Feedback
CDK for Terraform is an early experimental project and the development team would love your feedback to help guide the project.
- Contribute using the CONTRIBUTING.md guide.
- Ask a question on the HashiCorp Discuss using the terraform-cdk category.
- Report a bug or request a new feature.
- Browse all open issues.
Clone the project repository
git clone https://github.com/hashicorp/terraform-cdk.git
cd terraform-cdk/ yarn install
Build the project and packages