ubx-plugin-terraform plugin translates IR JSON to Terraform HCL (main.tf) and wraps the terraform CLI for plan, apply, and destroy operations.
Install
Configure
Inworkspace.xcl:
What the plugin generates
main.tf contains:
- File header comment (
# Generated by ubx-plugin-terraform — do not edit) terraform {}block (backend + required_providers)provider {}blocks (from XCL provider declarations)variable {}blocks (from XCL input declarations)locals {}block (from XCL locals declarations)resource {}blocks (from XCL resource declarations)output {}blocks (from XCL output declarations)
Type path mapping
XCL type paths are converted to Terraform resource type names using CamelCase → snake_case:| XCL type path | Terraform resource type |
|---|---|
aws.ec2.Vpc | aws_vpc |
aws.ec2.NatGateway | aws_ec2_nat_gateway |
aws.s3.Bucket | aws_s3_bucket |
aws_vpc | aws_vpc (single-segment: passed through) |
_ after CamelCase-to-snake_case conversion.
Input → variable mapping
XCLinput fields become Terraform variable blocks:
Output → output mapping
XCLoutput blocks become Terraform output blocks:
Plugin RPCs
| RPC | Description |
|---|---|
Compile | Generates main.tf, returns artifact_uri |
Plan | Runs terraform plan, returns summary |
Apply | Runs terraform apply, streams events |
Destroy | Runs terraform destroy, streams events |
Prerequisites
Theterraform binary must be on $PATH. Install from developer.hashicorp.com/terraform.
Backend
Terraform backend configuration is generated from the XCLbackend {} block:

