terraform/configs/testdata/invalid-files
Martin Atkins ff4ea042c2 config: Allow module authors to specify validation rules for variables
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.
2020-01-10 15:23:25 -08:00
..
data-count-and-for_each.tf Remove panic, update comment 2019-07-26 11:22:10 -04:00
data-reserved-lifecycle.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
data-reserved-locals.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
data-resource-lifecycle.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
interp-in-data-label.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
interp-in-rsrc-label.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
json-as-native-syntax.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
module-calls.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
native-syntax-as-json.tf.json Standardise directory name for test data 2019-06-30 10:16:15 +02:00
provider-reserved.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
provider-syntax.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
resource-count-and-for_each.tf Resource for_each 2019-07-22 10:51:16 -04:00
resource-lifecycle-badbool.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
resource-reserved-locals.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
resources-ignorechanges-all-legacymix.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
unexpected-attr.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
unexpected-block.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
variable-bad-default.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
variable-type-unknown.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
variable-validation-bad-msg.tf config: Allow module authors to specify validation rules for variables 2020-01-10 15:23:25 -08:00
variable-validation-condition-badref.tf config: Allow module authors to specify validation rules for variables 2020-01-10 15:23:25 -08:00
variable-validation-condition-noref.tf config: Allow module authors to specify validation rules for variables 2020-01-10 15:23:25 -08:00
version-variable.tf Standardise directory name for test data 2019-06-30 10:16:15 +02:00
zerolen.tf.json Standardise directory name for test data 2019-06-30 10:16:15 +02:00