terraform_validate_test
Rules
terraform_validate_test
load("@rules_terraform//terraform:terraform_validate_test.bzl", "terraform_validate_test")
terraform_validate_test(name, env, env_inherit, target, workspace)
A rule for running terraform validate on a Terraform target.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| env | Environment variables for the engine, set over the host's for a run and over the hermetic one for a test: TF_VAR_<name> for a root keyed on an input variable, TF_LOG, TF_CLI_ARGS_plan. Values are literal. TF_WORKSPACE here and workspace must agree. | Dictionary: String -> String | optional | {} |
| env_inherit | Variables the test takes from the environment bazel test ran in, AWS_PROFILE say. The variables tests scrub for hermeticity (the CLI configuration ones) cannot be inherited, and the runner says so. | List of strings | optional | [] |
| target | The target to validate. | Label | required | |
| workspace | Run in this Terraform workspace, over anything the environment or --test_env sets. Unset, the environment's TF_WORKSPACE applies, else default. One test per workspace is how a root keyed on terraform.workspace gets each one checked, and one binary per workspace runs it with no workspace select first. | String | optional | "" |