terraform_module
Rules
terraform_module
load("@rules_terraform//terraform:terraform_module.bzl", "terraform_module")
terraform_module(name, deps, srcs, data, disposable_state, lock)
One directory of terraform configuration: a root module, or a child that another module's module block names.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | What the configuration references: child terraform_modules for its local module blocks, a dependency hub (@<name> from a deps tag, or its //:providers / //:modules halves) or single @<name>//<namespace>_<name> providers, and terraform_provider or terraform_external_module targets. The module block names a child's path; deps says which target supplies it. A child in a package under this one lands at its relative path; any other is matched to the block whose source ends with its package name. | List of labels | optional | [] |
| srcs | The configuration files of this module: .tf, .tf.json, all directly in this target's package. A nested directory of configuration is its own module target, named by a module block. | List of labels | optional | [] |
| data | Additional files or targets that should be available at runtime. | List of labels | optional | [] |
| disposable_state | Whether local state may go with the run, for a module with no backend or cloud block. True, the default: the engine keeps state in the run's temp directory, which is deleted afterwards; a run that wrote state is kept and its path printed. False: state is kept under bazel-out/rules_terraform/ across runs, until bazel clean. An error when the module declares a backend. | Boolean | optional | True |
| lock | The module's .terraform.lock.hcl. Not needed when deps names a dependency hub, which carries its lock. | Label | optional | None |