terraform/internal/configs/testdata/invalid-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
..
data-count-and-for_each.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
data-invalid-provider-reference.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
data-reserved-locals.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
data-resource-lifecycle.tf configs: Decode preconditions and postconditions 2022-01-28 11:00:29 -05:00
everything-is-a-plan.tf configs: add decodeMovedBlock behind a locked gate. (#28973) 2021-06-21 10:53:16 -04:00
interp-in-data-label.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
interp-in-rsrc-label.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
json-as-native-syntax.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
module-calls.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
native-syntax-as-json.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider-localname-normalization.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider-reserved.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider-syntax.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resource-count-and-for_each.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resource-invalid-provider-reference.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resource-lifecycle-badbool.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resource-name-invalid.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resource-reserved-locals.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resources-ignorechanges-all-legacymix.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
unexpected-attr.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
unexpected-block.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variable-bad-default.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variable-bad-sensitive.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variable-type-unknown.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variable-validation-condition-badref.tf core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
variable-validation-condition-noref.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
version-variable.tf Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
zerolen.tf.json Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00