validation.condition must use value of variable to return true if valid, otherwise false
Must not produce errors
May use can function to detect errors and return true/false
e.g.
variable "my_id" { type = string validation { condition = length(var.my_id) > 4 && substr(var.my_id, 0, 3) == "foo" error_message = "The length of my_id must be greater than 4, starting with foo" }}
Setting Variables
Precedence:
Environment variables—in format TF_VAR_<variable name>