website: Update docs for check rule error messages
This commit is contained in:
parent
45d0c04707
commit
f21d0e8bf6
|
@ -335,11 +335,15 @@ Error: Resource postcondition failed
|
||||||
The selected AMI must be tagged with the Component value "nomad-server".
|
The selected AMI must be tagged with the Component value "nomad-server".
|
||||||
```
|
```
|
||||||
|
|
||||||
The `error_message` argument must always be a literal string, and should
|
The `error_message` argument can be any expression which evaluates to a string.
|
||||||
typically be written as a full sentence in a style similar to Terraform's own
|
This includes literal strings, heredocs, and template expressions. Multi-line
|
||||||
error messages. Terraform will show the given message alongside the name
|
error messages are supported, and lines with leading whitespace will not be
|
||||||
of the resource that detected the problem and any outside values used as part
|
word wrapped.
|
||||||
of the condition expression.
|
|
||||||
|
Error message should typically be written as one or more full sentences in a
|
||||||
|
style similar to Terraform's own error messages. Terraform will show the given
|
||||||
|
message alongside the name of the resource that detected the problem and any
|
||||||
|
outside values used as part of the condition expression.
|
||||||
|
|
||||||
## Preconditions or Postconditions?
|
## Preconditions or Postconditions?
|
||||||
|
|
||||||
|
|
|
@ -198,10 +198,13 @@ variable "image_id" {
|
||||||
```
|
```
|
||||||
|
|
||||||
If `condition` evaluates to `false`, Terraform will produce an error message
|
If `condition` evaluates to `false`, Terraform will produce an error message
|
||||||
that includes the sentences given in `error_message`. The error message string
|
that includes the result of the `error_message` expression. The error message
|
||||||
should be at least one full sentence explaining the constraint that failed,
|
should be at least one full sentence explaining the constraint that failed,
|
||||||
using a sentence structure similar to the above examples.
|
using a sentence structure similar to the above examples.
|
||||||
|
|
||||||
|
Error messages can be literal strings, heredocs, or template expressions. The
|
||||||
|
only valid reference in an error message is the variable under validation.
|
||||||
|
|
||||||
Multiple `validation` blocks can be declared in which case error messages
|
Multiple `validation` blocks can be declared in which case error messages
|
||||||
will be returned for _all_ failed conditions.
|
will be returned for _all_ failed conditions.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue