Skip to main content
The 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

ubx plugin install opentofu

Configure

In workspace.xcl:
workspace {
  engine = "opentofu"
}

Prerequisites

The tofu 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 tofu instead of terraform for all operations
  • Compatible with OpenTofu 1.6+
  • Supports OpenTofu-specific features where applicable (native state encryption, etc.)

Plugin RPCs

RPCDescription
CompileGenerates main.tf, returns artifact_uri
PlanRuns tofu plan, returns summary
ApplyRuns tofu apply, streams events
DestroyRuns tofu destroy, streams events

Migrating from Terraform to OpenTofu

Change the engine in workspace.xcl:
workspace {
  engine = "opentofu"   // was: "terraform"
}
Install the OpenTofu binary and the plugin:
ubx plugin install opentofu
The existing state and .xcl files are fully compatible — no changes required.