diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index c261c807..6118b09a 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -34,10 +34,9 @@ variable "prefix" { ) error_message = "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--')." } - validation { # must not exceed 16 characters in length - condition = length(var.prefix) <= 16 + condition = var.prefix == null || var.prefix == "" ? true : length(var.prefix) <= 16 error_message = "Prefix must not exceed 16 characters." } } diff --git a/solutions/security-enforced/variables.tf b/solutions/security-enforced/variables.tf index eb9a5a72..9dd55f45 100644 --- a/solutions/security-enforced/variables.tf +++ b/solutions/security-enforced/variables.tf @@ -34,10 +34,9 @@ variable "prefix" { ) error_message = "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--')." } - validation { # must not exceed 16 characters in length - condition = length(var.prefix) <= 16 + condition = var.prefix == null || var.prefix == "" ? true : length(var.prefix) <= 16 error_message = "Prefix must not exceed 16 characters." } }