From dc699992922b452ccc521c3dfe9c9c5c1f8376af Mon Sep 17 00:00:00 2001 From: Nuru Date: Thu, 4 Feb 2021 01:17:22 -0800 Subject: [PATCH] Copy validation to exports/context.tf (#123) --- exports/context.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exports/context.tf b/exports/context.tf index 3f4a341..81f99b4 100644 --- a/exports/context.tf +++ b/exports/context.tf @@ -159,11 +159,15 @@ variable "id_length_limit" { type = number default = null description = <<-EOT - Limit `id` to this many characters. + Limit `id` to this many characters (minimum 6). Set to `0` for unlimited length. Set to `null` for default, which is `0`. Does not affect `id_full`. EOT + validation { + condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0 + error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length." + } } variable "label_key_case" {