Files
opentf/internal/tofu/testdata/apply-enabled-module/apply-enabled-module.tf
Diogenes Fernandes 732623f604 Module expander for enabled field
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-10-03 13:17:47 -03:00

20 lines
399 B
HCL

variable "on" {
type = bool
}
module "mod1" {
source = "./mod1"
lifecycle {
enabled = var.on
}
}
output "result" {
// This is in a 1-tuple just because OpenTofu treats a fully-null
// root module output value as if it wasn't declared at all,
// but we want to make sure we're actually testing the result
// of this resource directly.
value = [try(module.mod1.result, "")]
}