Cloud Development Kit for Terraform (CDKTF) 0.11 introduces an easier way to add providers to your application and improvements to the debugging process.
We are excited to announce the release of Cloud Development Kit for Terraform (CDKTF) 0.11. With CDK for Terraform, you can write Terraform configurations in your choice of C#, Python, TypeScript, or Java (with experimental support for Go), and still benefit from the full ecosystem of Terraform providers and modules.
Key improvements in CDK for Terraform 0.11 include:
provider addcommand: This new CLI workflow does the work for you to check whether or not a prebuilt package exists for the provider that you want to use. If a prebuilt package exists, it will be installed for you. If not, the
getcommand will be run in the background to generate your provider resources classes.
One of the benefits of using CDKTF is that you can import any Terraform provider to use with your application. 0.11 adds a new command,
cdktf provider add to allow you to quickly and easily add prebuilt and local provider packages to your CDKTF application.
Prior to 0.11, there were two ways to add a provider to your project: define the provider in your
cdktf.json file and run
cdktf get to locally generate the provider resource classes, or run a package manager command, like
npm install for TypeScript applications, to install a prebuilt provider package. Prebuilt packages are faster to install, which makes them a better option if they are available for the providers you wish to use.
With the new
provider addcommand, you no longer need to check whether or not a prebuilt package exists for the provider that you want to use. If a prebuilt package exists, it will be installed for you. If no prebuilt package exists,
cdktf get will run in the background to automatically extract the schema from the Terraform provider to generate the necessary classes for your application. This new command works for all supported languages. For example, it will run an
npm install for a TypeScript application or
dotnet add for a C# application.
getcommand will continue to be supported (and should still be used for generating classes for Terraform modules), but the new option to run
cdktf provider add allows you to benefit from the speed of working with prebuilt provider packages, without having to do any of the lookup yourself.
0.11 adds a debug command that collects all relevant version information, and uses that information to print helpful debugging messages to the CLI when an error is thrown. Additional information on troubleshooting errors can be found on the new Debugging documentation page.
The CDK for Terraform CHANGELOG contains a comprehensive list of additional enhancements and bug fixes. Please note that CDKTF 0.11 contains breaking changes that may require code updates. See the CHANGELOG and 0.11 Upgrade Guide for details.
This release also includes improvements to working with lists, building on work first released in 0.10. Generated provider code bindings have been improved to allow referencing list attributes as a whole list, instead of just individual items of that list. In 0.10 we released this improvement for computed, i.e. read-only, lists, but it is now available for all lists.
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.
Terraform Enterprise enhances observability and cuts operational burden with improved run metrics, identity-based storage authentication, and versioned documentation.
Now generally available, HashiCorp Terraform 1.3 introduces optional object type attributes with defaults, and enhancements to moved blocks, improving extensibility and maintainability of Terraform modules.
Drift detection is essential to maintaining efficiency while minimizing risk and giving teams confidence in your infrastructure as code (IaC) provisioning workflow.