Using the Terraform CDK for developers
So far in this book, we have seen how to write Terraform configuration using HCL. HCL is a configuration language that has the advantage of being easy to read for humans. However, application developers who wanted to use Terraform had to learn a new language.
To address this issue, in August 2022, HashiCorp announced the availability of a Cloud Development Kit for Terraform (CDKTF). Read the announcement blog post here: https://www.hashicorp.com/blog/cdk-for-terraform-now-generally-available.
CDKTF is a tool that allows you to define IaC using familiar programming languages such as TypeScript, JavaScript, Python, and Java.
With CDKTF, you write code that describes your infrastructure in a higher-level language, allowing for more abstraction layers compared to the Terraform (HCL) language. CDKTF synthesizes your code, i.e., generates the equivalent Terraform configuration under the hood. This allows you to use a familiar programming...