terraform/internal/configs/testdata/valid-files
Alisdair McDiarmid b06fe04621 core: Check rule error message expressions
Error messages for preconditions, postconditions, and custom variable
validations have until now been string literals. This commit changes
this to treat the field as an HCL expression, which must evaluate to a
string. Most commonly this will either be a string literal or a template
expression.

When the check rule condition is evaluated, we also evaluate the error
message. This means that the error message should always evaluate to a
string value, even if the condition passes. If it does not, this will
result in an error diagnostic.

If the condition fails, and the error message also fails to evaluate, we
fall back to a default error message. This means that the check rule
failure will still be reported, alongside diagnostics explaining why the
custom error message failed to render.

As part of this change, we also necessarily remove the heuristic about
the error message format. This guidance can be readded in future as part
of a configuration hint system.
2022-03-04 15:35:39 -05:00
..
backend.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
cloud.tf Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
data-sources.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
empty.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
empty.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
locals.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
locals.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
outputs.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider-configs.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
providers-explicit-implied.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
references.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
required-providers.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
required-version.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resources-ignorechanges-all.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resources-ignorechanges-all.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resources.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
valid-language-edition.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variable_validation.tf core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
variables.tf configs: explicitly nullable variable values 2021-10-29 13:59:46 -04:00
variables.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00