From b2576a3df366b54c31aaaf520819b38e2643134b Mon Sep 17 00:00:00 2001 From: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com> Date: Tue, 5 Apr 2022 15:50:24 -0400 Subject: [PATCH] Update page name to Custom Conditions per feedback --- website/data/language-nav-data.json | 4 ++-- ...stom-validation-rules.mdx => custom-conditions.mdx} | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) rename website/docs/language/expressions/{custom-validation-rules.mdx => custom-conditions.mdx} (96%) diff --git a/website/data/language-nav-data.json b/website/data/language-nav-data.json index ecb6900c7b..656cbe1019 100644 --- a/website/data/language-nav-data.json +++ b/website/data/language-nav-data.json @@ -280,8 +280,8 @@ "path": "expressions/version-constraints" }, { - "title": "Custom Validation Rules", - "path": "expressions/custom-validation-rules" + "title": "Custom Conditions", + "path": "expressions/custom-conditions" } ] }, diff --git a/website/docs/language/expressions/custom-validation-rules.mdx b/website/docs/language/expressions/custom-conditions.mdx similarity index 96% rename from website/docs/language/expressions/custom-validation-rules.mdx rename to website/docs/language/expressions/custom-conditions.mdx index 3c2caae4c6..6b57f4f4a6 100644 --- a/website/docs/language/expressions/custom-validation-rules.mdx +++ b/website/docs/language/expressions/custom-conditions.mdx @@ -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`.