ff4ea042c2
The existing "type" argument allows specifying a type constraint that allows for some basic validation, but often there are more constraints on a variable value than just its type. This new feature (requiring an experiment opt-in for now, while we refine it) allows specifying arbitrary validation rules for any variable which can then cause custom error messages to be returned when a caller provides an inappropriate value. variable "example" { validation { condition = var.example != "nope" error_message = "Example value must not be \"nope\"." } } The core parts of this are designed to do as little new work as possible when no validations are specified, and thus the main new checking codepath here can therefore only run when the experiment is enabled in order to permit having validations. |
||
---|---|---|
.. | ||
data-count-and-for_each.tf | ||
data-reserved-lifecycle.tf | ||
data-reserved-locals.tf | ||
data-resource-lifecycle.tf | ||
interp-in-data-label.tf | ||
interp-in-rsrc-label.tf | ||
json-as-native-syntax.tf | ||
module-calls.tf | ||
native-syntax-as-json.tf.json | ||
provider-reserved.tf | ||
provider-syntax.tf | ||
resource-count-and-for_each.tf | ||
resource-lifecycle-badbool.tf | ||
resource-reserved-locals.tf | ||
resources-ignorechanges-all-legacymix.tf | ||
unexpected-attr.tf | ||
unexpected-block.tf | ||
variable-bad-default.tf | ||
variable-type-unknown.tf | ||
variable-validation-bad-msg.tf | ||
variable-validation-condition-badref.tf | ||
variable-validation-condition-noref.tf | ||
version-variable.tf | ||
zerolen.tf.json |