CDKTF
By HashiCorp
CDKTF (Cloud Development Kit for Terraform) is a HashiCorp framework that lets developers define infrastructure using general-purpose programming languages like TypeScript, Python, or Go, which synthesize into Terraform configuration.
Definition
CDKTF (Cloud Development Kit for Terraform) is a HashiCorp framework that lets developers define infrastructure using general-purpose programming languages like TypeScript, Python, or Go, which synthesize into Terraform configuration.
Overview
CDKTF brings the Cloud Development Kit pattern, popularized by AWS CDK, to Terraform's ecosystem. Instead of writing infrastructure definitions directly in HCL (Terraform's native configuration language), developers write code in a supported language, and CDKTF synthesizes that code into standard Terraform JSON configuration behind the scenes, which the regular Terraform CLI then plans and applies. This lets teams use familiar programming constructs — loops, conditionals, functions, classes, and existing package ecosystems — to generate infrastructure definitions, which can reduce repetition for complex or highly parameterized environments compared to hand-written HCL. Because it still relies on Terraform's core engine and provider ecosystem underneath, CDKTF supports the same wide range of providers for AWS, Azure, Google Cloud, and other services that Terraform itself supports. CDKTF is aimed at teams that prefer expressing infrastructure logic in a general-purpose language rather than a domain-specific configuration language, often because their infrastructure code needs to share logic, types, or tooling with the rest of their application codebase. It's a smaller niche compared to plain Terraform or OpenTofu usage, and its long-term relationship to those projects has evolved alongside HashiCorp's licensing changes and the OpenTofu fork.
Key Features
- Infrastructure defined in general-purpose languages like TypeScript, Python, Java, C#, and Go
- Synthesizes code into standard Terraform JSON configuration under the hood
- Full access to the Terraform provider ecosystem for major cloud platforms
- Supports familiar programming constructs — loops, functions, classes — for infrastructure logic
- Integrates with existing package managers and testing tools of the chosen language
- Built and maintained by HashiCorp, aligned with Terraform's core engine