AWS Open Source Blog

Announcing CDK for Terraform on AWS

Two years ago, HashiCorp began collaborating with AWS and their AWS Cloud Development Kit (AWS CDK) team to develop Cloud Development Kit for Terraform (CDKTF), an open source tool (Mozilla 2.0) that provides a developer-friendly workflow for deploying cloud infrastructure with Terraform. Over the last two years, we have seen the CDK community grow, with many organizations adopting AWS CDK, CDK for Kubernetes (CDK8s), and CDK for Terraform (CDKTF), which are open source workflows to simplify cloud development and empower developers to define and provision infrastructure in their preferred programming language. Today, we are pleased to announce with HashiCorp that CDK for Terraform (CDKTF) is now generally available (GA).

Built on top of the open source JSII library, CDK for Terraform allows you to write Terraform configurations in your choice of C#, Python, TypeScript, Java, or Go and still benefit from the full ecosystem of Terraform providers and modules. You can import any existing provider or module from the Terraform Registry into your application, and CDKTF will generate resource classes for you to interact with in your target programming language.

With CDKTF, developers can set up their infrastructure as code without context switching from their familiar programming language, using the same tooling and syntax to provision infrastructure resources as they are using to define the application business logic. Teams can collaborate in familiar syntax, while still leveraging the power of the Terraform ecosystem and deploying their infrastructure configurations via established Terraform deployment pipelines.

Collaborate on Construct Hub

One shared pattern across all CDKs, is that they allow you to manage complexity and reduce code duplication by creating custom abstraction layers, referred to as constructs. Constructs allow developers to reuse existing resource configurations written in their programming language rather than defining resources by hand, simplifying development, and speeding up delivery of new features and services.

You can write your own custom constructs to share across your team and organization, and you can also browse Construct Hub to discover open source construct libraries for all CDKs. Check out the prebuilt provider constructs currently available for CDKTF on Construct Hub.

CDK for Terraform with Amazon Elastic Kubernetes Service (Amazon EKS)

To learn more about using CDK for Terraform in practice, check out this demo from a senior cloud architect at AWS. You’ll learn how platform and developer teams can collaborate effectively using CDK for Terraform, Terraform Cloud, and Sentinel to safely deploy Amazon EKS workloads.

It also includes a detailed tutorial of the workflow that platform and developer teams can use to collaborate on Kubernetes deployments with HashiCorp Terraform, Sentinel policies, CDK for Terraform, and Amazon EKS.

Try CDK for Terraform and AWS CDK

Learn more about the release on the HashiCorp blog and an Aug. 24, 2022 webinar, where you’ll find information about new features, including additional testing support and a new deployment option for using CDKTF with Terraform Cloud.

If you’re new to the project, the tutorials for CDK for Terraform on HashiCorp Learn are the best way to get started, or dive deeper into the documentation beginning with this overview of CDKTF. You can learn more about AWS CDK here, and if you’re interested in contributing to it yourself, you can follow steps to do that here.

Donna Lee

Donna Lee

Donna is a product marketing manager at Hashicorp.

Sarah MacDonald

Sarah MacDonald

Sarah is a product manager on CDK for Terraform at Hashicorp. An educator turned product manager and content strategist, Sarah is passionate about the potential that technology holds for social impact.