Update page name to Custom Conditions per feedback

This commit is contained in:
Laura Pacilio 2022-04-05 15:50:24 -04:00
parent 040985f6e1
commit b2576a3df3
2 changed files with 8 additions and 6 deletions

View File

@ -280,8 +280,8 @@
"path": "expressions/version-constraints"
},
{
"title": "Custom Validation Rules",
"path": "expressions/custom-validation-rules"
"title": "Custom Conditions",
"path": "expressions/custom-conditions"
}
]
},

View File

@ -1,14 +1,16 @@
---
page_title: Custom Validation Rules - Configuration Language
page_title: Custom Conditions - Configuration Language
description: >-
Validate requirements for variables, outputs, and within lifecycle blocks so Terraform can produce better error messages in context.
---
# Custom Validation Rules
# Custom Conditions
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.
You can create custom conditions that produce custom error messages for several types of objects in a configuration. For example, you may want to check to whether an incoming image ID is formatted properly.
You can create custom validations with the following types of expressions.
Custom condition checks 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.
You can create custom conditions with the following types of expressions.
- Add [`validation` blocks](input-variable-validation) inside input `variable` blocks.
- Add [`precondition` and `postcondition`](#preconditions-and-postconditions) blocks inside `lifecycle` blocks and `precondition` blocks inside `output blocks`.