Skip to content

Commit dc69999

Browse files
authored
Copy validation to exports/context.tf (#123)
1 parent 3a7014c commit dc69999

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exports/context.tf

+5-1
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,15 @@ variable "id_length_limit" {
159159
type = number
160160
default = null
161161
description = <<-EOT
162-
Limit `id` to this many characters.
162+
Limit `id` to this many characters (minimum 6).
163163
Set to `0` for unlimited length.
164164
Set to `null` for default, which is `0`.
165165
Does not affect `id_full`.
166166
EOT
167+
validation {
168+
condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0
169+
error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length."
170+
}
167171
}
168172

169173
variable "label_key_case" {

0 commit comments

Comments
 (0)