terraform/internal/command/testdata/test/with-default-variables/main.tftest.hcl
Liam Cervante 53afa2cd2f
terraform test: move variable evaluation into the terraform test graph (#37205)
* terraform test: move variable evaluation into the terraform test graph

* make copyrightfix
2025-06-06 10:11:35 +02:00

31 lines
547 B
HCL

variable "input_one" {
type = string
default = "hello"
}
variable "input_two" {
type = string
default = "world" // we will override this an external value
}
variables {
value = "${var.input_two}_more"
}
run "test" {
assert {
condition = test_resource.resource.value == "hello - universe"
error_message = "bad concatenation"
}
}
run "nested_ref" {
variables {
input_two = var.value
}
assert {
condition = test_resource.resource.value == "hello - universe_more"
error_message = "bad concatenation"
}
}