{"library":"react-hcl","title":"react-hcl","description":"react-hcl (v0.2.2) is an experimental JSX/TSX-to-Terraform (.tf) transpiler that leverages a custom JSX runtime to convert React-like components directly into HCL, Terraform's configuration language. Unlike traditional Infrastructure as Code tools (e.g., Pulumi, CDKTF) which use actual programming languages to generate infrastructure, react-hcl translates JSX syntax at build time into pure Terraform files, enabling a declarative, component-based approach without any runtime overhead. It integrates with TypeScript (peer dep ^5), ships TypeScript definitions, and is intended for static compilation only—no runtime dependencies. Release cadence is experimental; breaking changes expected.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install react-hcl"],"cli":null},"imports":["import { jsx } from 'react-hcl'","import { resource } from 'react-hcl'","import { jsxDev } from 'react-hcl/jsx-dev-runtime'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"jsx\": \"react-jsx\",\n    \"jsxImportSource\": \"react-hcl\"\n  }\n}\n\n// main.tsx\nimport { resource, jsx } from 'react-hcl';\n\nexport const App = () => (\n  <resource\n    type=\"aws_instance\"\n    name=\"example\"\n    args={{\n      ami: \"ami-0c55b159cbfafe1f0\",\n      instance_type: \"t2.micro\"\n    }}\n  />\n);\n\n// Run:\n// npx tsc --noEmit\n// react-hcl compile main.tsx > output.tf","lang":"typescript","description":"Shows project setup with tsconfig for react-hcl JSX factory, a component using resource helper, and CLI compile command to generate Terraform HCL.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}