OpenTofu Rules
Everything under //tofu mirrors //terraform but binds to
//tofu:toolchain_type. Rule bodies are identical — only the
resolved toolchain differs — so behavior stays in lockstep between the
two engines. Data-only rules (tofu_module, tofu_external_module,
tofu_provider, tofu_provider_group) are literal aliases for their terraform_*
counterparts, provided so an OpenTofu-only project never has to import
a terraform_* symbol.
Public rules
- tofu_binary —
bazel runwrapper for anytofusubcommand. - tofu_module — alias for
terraform_module. - tofu_external_module — alias for
terraform_external_module. - tofu_provider — alias for
terraform_provider. - tofu_test — runs OpenTofu's HCL native test framework, reporting each
runblock as a JUnit test case. - tofu_plan_test — runs a real
planand keeps it as a reviewable test output; needs network. - tofu_validate_test —
tofu validateas a Bazel test. - tofu_fmt_test —
tofu fmt -checkas a Bazel test. - tofu_providers_lock —
bazel runupdater that writes.terraform.lock.hclwith the toolchaintofu. - tofu_providers_lock_test — alias for the terraform drift test.
Module extensions
- extensions —
tofu:toolchainanddepstags.