Skip to content

Commit 42d73fe

Browse files
committed
Rename page in sidebar and change filename
1 parent 2449fad commit 42d73fe

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎website/data/language-nav-data.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@
280280
"path": "expressions/version-constraints"
281281
},
282282
{
283-
"title": "Pre and Postconditions",
284-
"path": "expressions/preconditions-postconditions"
283+
"title": "Custom Data Validation",
284+
"path": "expressions/custom-data-validation"
285285
}
286286
]
287287
},

website/docs/language/expressions/preconditions-postconditions.mdx renamed to website/docs/language/expressions/custom-data-validation.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ description: >-
66

77
# Custom Data Validation
88

9-
You can create validation checks for configuration requirements that return detailed error messages to consumers. Custom validations are optional, but they can help capture assumptions that might be only implied, helping future maintainers understand the configuration design and intent. They also return useful information about errors earlier and in context, helping consumers more easily diagnose issues in their configurations.
9+
You can create validation checks with custom error messages for several types of objects in a configuration. Custom validations are optional, but they can help capture assumptions that might be only implied, helping future maintainers understand the configuration design and intent. They also return useful information about errors earlier and in context, helping consumers more easily diagnose issues in their configurations.
1010

1111
You can create custom validations with the following types of expressions.
1212
- Add [`validation` blocks](input-variable-validation) inside input `variable` blocks.
13-
- Add []`precondition` and `postcondition`](#preconditions-and-postconditions) blocks inside `lifecycle` blocks and `precondition` blocks inside `output blocks`.
13+
- Add [`precondition` and `postcondition`](#preconditions-and-postconditions) blocks inside `lifecycle` blocks and `precondition` blocks inside `output blocks`.
1414

15-
The `validation`, `precondition`, and `postcondition` blocks all require a [`condition` attribute](#condition-expressions) that describes the validation requirements and an [`error_message` attribute](#error-messages) that contains explanatory text that Terraform will display to the user.
15+
All of these methods require a [`condition` attribute](#condition-expressions) that describes the validation requirements and an [`error_message` attribute](#error-messages) that contains explanatory text that Terraform will display to the user.
1616

1717
-> **Note:** Input variable validation is available in Terraform CLI v0.13.0 and later. Preconditions and postconditions are available in Terraform CLI v1.2.0 and later.
1818

@@ -135,7 +135,7 @@ We recommend also considering the following factors.
135135
- Whether it is helpful to declare the same or similar conditions as both preconditions and postconditions. This can be useful if the postcondition is in a different module than the precondition because it lets the modules verify one another as they evolve independently.
136136

137137

138-
## Usage Examples
138+
### Usage Examples
139139

140140
The following example shows possible uses for variable validation, preconditions and postconditions.
141141

@@ -245,7 +245,7 @@ The preconditions, and postconditions declare the following assumptions and guar
245245
problem immediately, before any other components rely on the
246246
insecurely-configured component.
247247

248-
## Condition Expressions
248+
## Condition Expressions
249249

250250
The variable `validation` block and the `precondition` and `postcondition` blocks all require an argument named `condition`, whose value is a boolean expression which should return `true` if the intended assumption holds or `false` if it does not.
251251

@@ -257,8 +257,6 @@ Condition expressions have the following requirements.
257257
You can use any of Terraform's built-in functions or language operators
258258
in a condition as long as the expression is valid and returns a boolean result.
259259

260-
## Common Condition Expression Features
261-
262260
Because condition expressions must produce boolean results, they can often
263261
use built-in functions and language features that are less common elsewhere
264262
in the Terraform language. The following language features are particularly

0 commit comments

Comments
 (0)