terraform/internal/configs/testdata
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
..
config-build Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config-diagnostics skip provider resolution when there are errors 2021-12-06 14:28:34 -05:00
dir-empty Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
error-files configs: Validate pre/postcondition self-refs 2022-02-03 09:37:22 -05:00
escaping-blocks Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
experiments Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
invalid-files core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
invalid-modules configs: Decode preconditions and postconditions 2022-01-28 11:00:29 -05:00
nested-backend-warning Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
nested-cloud-warning Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
nested-errors Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
provider-reqs Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
providers-explicit-fqn Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
valid-files core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
valid-modules add failing test for IgnoreAllChanges override 2021-11-01 19:00:54 +00:00
warning-files configs: Decode preconditions and postconditions 2022-01-28 11:00:29 -05:00