Cloud Development Kit for Terraform (CDKTF) has reached its first GA release, adding full support for Go and providing a GitHub action to use with Terraform Cloud.
We are excited to announce the first generally available (GA) release of Cloud Development Kit for Terraform, with version 0.12. With CDK for Terraform (CDKTF), you can write Terraform configurations in your choice of TypeScript, Python, C#, Java, or Go, and still benefit from the full ecosystem of HashiCorp Terraform providers and modules.
Two years ago, we announced a collaboration with Amazon Web Services (AWS) and its Cloud Development Kit (CDK) team, to offer a community preview of Cloud Development Kit for Terraform (CDKTF), a solution to provide a developer-friendly workflow for deploying cloud infrastructure. Since then, we have seen quite a few organizations adopt CDKTF, and we have learned from those early adopters how to improve the developer tooling and core workflow. Today, we are pleased to announce that CDKTF is now generally available and ready for production usage.
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 use to define the application business logic. Teams can collaborate in a familiar syntax, while still leveraging the power of the Terraform ecosystem and deploying their infrastructure configurations via established Terraform deployment pipelines.
CDK for Terraform allows you to manage complexity and reduce code duplication by creating custom abstraction layers, referred to as constructs. Constructs let developers reuse existing resource configurations written in their programming language rather than defining resources by hand, which simplifies development and speeds delivery of new features and services.
The choice of whether to work with Terraform in HashiCorp configuration language (HCL) or one of CDKTF’s supported programming languages can be made on a team-by-team or project-by-project basis, because CDKTF can interoperate with all existing Terraform providers and modules, and the JSON configuration file that is synthesized from your application code can be deployed with Terraform directly.
CDKTF 0.12 includes a variety of new features and functionality to help ensure that the product is ready for production usage. Let’s take a look at some of the highlights:
Following the AWS announcement in May that Go is fully supported by JSII, we are pleased to announce that CDK for Terraform now provides full support for using Go in your CDKTF application. You can find example projects using Go in our documentation.
CDKTF application code synthesizes into JSON that can be used by HashiCorp Terraform Cloud and Terraform Enterprise to deploy your infrastructure configuration. To facilitate this workflow, we have published a new GitHub Action that allows you to run CDKTF code as part of your CI/CD workflow. Check out the new Action on the GitHub Marketplace, and visit our new Deployment Patterns documentation to learn more about methods and best practices for deploying your CDKTF applications.
Unit tests are an important part of the development process, so we are pleased to announce that we have extended our testing utilities to provide support for all CDKTF-supported programming languages. Learn more in our Unit Tests documentation.
CDKTF 0.12 adds support for resource-level and block-level iterators to enable workflows that users are familiar with in HCL. We have introduced a new API, called TerraformIterator, that supports dynamic list iterations on the block and resource level. Please visit the Iterators documentation to learn more.
convert command translates Terraform configuration written in HCL to the equivalent configuration in your preferred language. This can be used to help migrate an existing HCL codebase to a CDKTF application, or to translate Terraform provider documentation and examples that may be available only in HCL. In CDKTF 0.12, we improved the functionality of this command to be more accurate in all CDKTF-supported programming languages.
The CDK for Terraform CHANGELOG contains a comprehensive list of additional enhancements and bug fixes. Please note that CDKTF 0.12 contains breaking changes that may require code updates. Please see the CHANGELOG and CDKTF 0.12 Upgrade Guide for details.
If you’re new to the project, the tutorials for CDK for Terraform on HashiCorp Learn are the best way to get started. You can dive deeper into our documentation beginning with this overview of CDKTF. To learn more about using CDK for Terraform in practice, check out demos from the engineering team at Mozilla’s Pocket, and a senior cloud architect at Amazon Web Services.
Whether you’re experimenting or actively using CDK for Terraform, we’d love to hear from you. Please file any bugs you encounter, let us know about your feature requests, and share other questions, thoughts, and experiences in the CDK for Terraform discussion forum.
Join us for a webinar on August 24th at 11 am EDT to learn more about what is available in this GA release, and see how to use CDKTF with a live demo.
Terraform Sentinel policies are now available in the Terraform Registry so you can publish policies you want to share and search the Registry for policies you need.
In the journey toward a modern service-based networking solution, core workflows are needed for discovering services, securing service communications, automating networking tasks, and controlling access.
Synchronize HCP Consul services as backend address pools for Microsoft Azure Application Gateway using Consul-Terraform-Sync (CTS).