opentofu_module — alias for terraform_module.
Same rule under both names: a bundle of .tf files + deps + optional
lock is engine-neutral, so opentofu_module is just a naming alias so
OpenTofu-only projects don't have to import a terraform_* symbol.
Rules
opentofu_module
load("@rules_terraform//opentofu:opentofu_module.bzl", "opentofu_module")
opentofu_module(name, deps, srcs, data, lock, main, module_sources)
Defines a Terraform module that can be used as a dependency in other Terraform targets.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Other terraform_module, terraform_provider, terraform_provider_group, terraform_external_module, or terraform_module_group targets that this module depends on. | List of labels | optional | [] |
| srcs | Terraform source files (.tf) that make up this module. | List of labels | optional | [] |
| data | Additional files or targets that should be available at runtime. | List of labels | optional | [] |
| lock | An optional .terraform.lock.hcl file. | Label | optional | None |
| main | An explicit file to use for the entrypoint of the module. If unspecified, main.tf or the first .tf file will be used. | Label | optional | None |
| module_sources | Mapping of Terraform module source paths to Bazel target labels. Use this to map local module "foo" { source = "./modules/vpc" } references to Bazel targets from other packages or external bzlmod dependencies. Keys are the Terraform source paths, values are Bazel labels providing TerraformInfo. The init tool will symlink these at the expected paths. | Dictionary: String -> String | optional | {} |