BlogsAblyTerraform Configuration Generation

Terraform Configuration Generation

Terraform Configuration Generation

1
posts
2026

tfgen is a new tool developed by Ably to configure Terraform stacks using plain Go. It was created as a replacement for HashiCorp's CDKTF after its development was sunset. tfgen aims to provide a simpler and more flexible way to generate Terraform-compatible JSON, allowing engineers to leverage their existing Go expertise for infrastructure as code. The tool emphasizes direct configuration and validation through Terraform's own tooling, removing the need for generated types and build steps. It also supports AI-assisted migration and has been open-sourced to benefit the community.

2026

Introducing tfgen: configure your Terraform stacks using plain Go

7/21/2026

This post introduces tfgen, a new open-source tool developed by Ably to generate Terraform configurations using Go. It details the motivation for creating tfgen, stemming from the sunsetting of CDKTF and the desire for a more flexible solution. The post explains tfgen's design, which focuses on a simple public interface for defining resources and their configurations in Go, producing Terraform-compatible JSON. It highlights the use of AI in migrating existing CDKTF configurations to tfgen and showcases examples of using tfgen with the Ably Terraform provider. The post also clarifies tfgen's compatibility with OpenTofu and its differences from CDKTF.