Author in TSX, render HCL
Use components, props, conditionals, and loops to describe configuration, then generate plain Terraform .tf files.
A TSX authoring layer for rendering Terraform configuration.
CDK-style tools often model infrastructure through imperative construction APIs. react-hcl treats Terraform configuration as a render target instead.
For example, this TSX:
import { Resource } from "react-hcl";
export default (
<Resource
type="aws_s3_bucket"
label="assets"
bucket="my-assets"
/>
);Generates this HCL:
resource "aws_s3_bucket" "assets" {
bucket = "my-assets"
}init, generation, and Terraform validation.