From 54cc4dadf68b6e0f3ef52eb60f8267da9ce2a789 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 25 Feb 2021 13:57:34 -0800 Subject: [PATCH] configs: A better error message for custom variable validation Our previous message conflated the requirement for a full sentence with the suggestion to write in a style similar to Terraform's built-in error messages, which created a sense that the system would actively reject an error message written in another language. There's no intent here to block writing error messages in other languages, but there is a practical consideration that Terraform's UI output is currently not localized and so consistency with Terraform's other output, if that's important to a module author, will typically mean writing the error message in English. --- configs/named_values.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/named_values.go b/configs/named_values.go index 61aa2f927..cfa7bfc8b 100644 --- a/configs/named_values.go +++ b/configs/named_values.go @@ -382,7 +382,7 @@ func decodeVariableValidationBlock(varName string, block *hcl.Block, override bo diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: errSummary, - Detail: "Validation error message must be at least one full English sentence starting with an uppercase letter and ending with a period or question mark.", + Detail: "The validation error message must be at least one full sentence starting with an uppercase letter and ending with a period or question mark.\n\nYour given message will be included as part of a larger Terraform error message, written as English prose. For broadly-shared modules we suggest using a similar writing style so that the overall result will be consistent.", Subject: attr.Expr.Range().Ptr(), }) }