mirror of
https://github.com/hashicorp/terraform.git
synced 2026-06-09 00:42:48 -04:00
While variable validation rules can now include other references, they also still need to reference the variable itself. If the variable itself wasn't referenced, then the resulting `Invalid value for variable` error would not make sense. Having no self-references will also cause a panic when trying to reinsert the variable name into the evaluation context, because the context variables map could be nil. A check for a nil map does not need to be added however, because ensuring that a self-reference exists means there will always be at least 1 variable in scope.
10 lines
162 B
HCL
10 lines
162 B
HCL
locals {
|
|
something = "else"
|
|
}
|
|
|
|
variable "validation" {
|
|
validation {
|
|
condition = local.something == "else"
|
|
error_message = "Something else."
|
|
}
|
|
}
|