DEV Community

Sebastian Korfmann
Sebastian Korfmann

Posted on

2 2

CDK for Terraform 0.2

The CDK (Cloud Development Kit) for Terraform allows developers to use familiar programming languages to define cloud infrastructure and provision it through HashiCorp Terraform.

We released CDK for Terraform 0.2 recently. Besides from various smaller and bigger improvements, the focus was on iterating on the support for Terraform modules.

Up until now, we did support generating code bindings for Terraform Modules which are published on the Terraform Registry only. The Terraform Registry API provides all the metadata we needed to generate code straight from the API response without having to process the Terraform module sources.

With the new 0.2 release, we changed the internal implementation for fetching modules to support all sources which Terraform supports. This includes Modules from Github, HTTP and local disk. Since we're not relying on the Terraform Registry API anymore, we had to come up with our own solution to extract the relevant metadata.

The main challenge here was: CDK for Terraform is primarily written in Typescript, while most of the Terraform ecosystem relies on Go. To bridge this gap, WebAssembly came to the rescue. It enabled us to leverage existing tools from the Go community by building a thin wrapper in Typescript. More details about the learnings from that journey in one of the next posts :)

In the meantime, please go ahead and checkout the latest release of CDK for Terraform. We're always looking for feedback and ideas to drive the product forward.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (1)

Collapse
 
danielmschmidt profile image
Daniel Schmidt •

Nice solution to leverage web assembly here!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more