ubx-plugin-opentofu plugin is functionally identical to the Terraform plugin but delegates to the tofu CLI instead of terraform. It generates the same main.tf HCL format.
Install
Configure
Inworkspace.xcl:
Prerequisites
Thetofu binary must be on $PATH. Install from opentofu.org.
Generated output
Same as the Terraform plugin — generates.ubx/main.tf. See Terraform plugin for the full mapping reference.
Differences from Terraform plugin
- Calls
tofuinstead ofterraformfor all operations - Compatible with OpenTofu 1.6+
- Supports OpenTofu-specific features where applicable (native state encryption, etc.)
Plugin RPCs
| RPC | Description |
|---|---|
Compile | Generates main.tf, returns artifact_uri |
Plan | Runs tofu plan, returns summary |
Apply | Runs tofu apply, streams events |
Destroy | Runs tofu destroy, streams events |
Migrating from Terraform to OpenTofu
Change the engine inworkspace.xcl:
.xcl files are fully compatible — no changes required.
