terraform/internal
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
..
addrs check for nested module index changes 2022-01-04 09:20:47 -05:00
backend [cloud] run tasks output formatting 2022-02-24 14:02:37 -05:00
builtin
cloud Updated for latest go-tfe run task changes 2022-02-25 15:32:16 -05:00
command Merge pull request #30525 from nozaq/provider-config-default 2022-02-22 16:13:41 -05:00
communicator de-linting 2021-09-01 11:36:21 -04:00
configs core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
copy
dag do not use pointer addr strings as map keys in set 2022-01-05 11:28:47 +00:00
depsfile providercache: Discard lock entries for unused providers 2021-12-17 15:30:21 -08:00
didyoumean
e2e
earlyconfig addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
experiments experiments: New "preconditions_postconditions" experiment 2022-01-28 11:00:29 -05:00
getmodules getmodules: Use go-getter v1.5.10 and return to upstream GitGetter 2022-01-03 11:44:16 -08:00
getproviders Fix failing lint check for deprecated x/crypto/openpgp library 2021-11-18 14:59:29 -06:00
grpcwrap
helper/slowmessage remove wrapped streams and readline 2021-10-28 11:51:39 -04:00
httpclient
initwd addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
instances InstancesForModule should not panic 2021-12-17 13:31:41 -05:00
ipaddr lang/funcs: Preserve IP address leading zero behavior from Go 1.16 2021-08-17 15:20:05 -07:00
lang lang: Further limit the console-only type function 2022-02-10 06:12:58 -05:00
legacy
logging cleanup panic output 2021-12-17 11:57:52 -05:00
modsdir
moduledeps
moduletest
plans go.mod: go get google.golang.org/protobuf@v1.27.1 2021-10-11 16:37:39 -07:00
plugin internal/plugin[6]: Add generated mocks 2021-10-28 20:16:26 -05:00
plugin6 Introduce Terraform Plugin Protocol 6.2 with legacy_type_system fields from Protocol 5 (#30375) 2022-01-20 09:57:42 -05:00
provider-simple
provider-simple-v6
provider-terraform/main
providercache providercache: Discard lock entries for unused providers 2021-12-17 15:30:21 -08:00
providers
provisioner-local-exec/main
provisioners
refactoring refactoring: Implied move statements can be cross-package 2022-01-11 08:43:57 -08:00
registry command: make module installation interruptible 2021-11-11 12:28:10 +00:00
repl lang: Further limit the console-only type function 2022-02-10 06:12:58 -05:00
replacefile Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
states Relax test to focus on the behavior we care about (encoded == encoded) 2022-01-05 14:38:53 -08:00
terminal remove the use of panicwrap 2021-10-28 11:51:39 -04:00
terraform core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
tfdiags
tfplugin5 go.mod: go get google.golang.org/protobuf@v1.27.1 2021-10-11 16:37:39 -07:00
tfplugin6 Introduce Terraform Plugin Protocol 6.2 with legacy_type_system fields from Protocol 5 (#30375) 2022-01-20 09:57:42 -05:00
typeexpr