Skip to content

Commit eeca156

Browse files
author
Kosta Welke
committed
variable validation: || does not short-circuit
1 parent 87ee18d commit eeca156

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/workload-identity/variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ variable "gcp_sa_display_name" {
121121
default = null
122122

123123
validation {
124-
condition = length(var.gcp_sa_display_name) <= 100
124+
condition = var.gcp_sa_display_name == null ? true : length(var.gcp_sa_display_name) <= 100
125125
error_message = "The Google service account display name must be at most 100 characters"
126126
}
127127
}
@@ -133,7 +133,7 @@ variable "gcp_sa_description" {
133133
default = null
134134

135135
validation {
136-
condition = length(var.gcp_sa_description) <= 256
136+
condition = var.gcp_sa_description == null ? true : length(var.gcp_sa_description) <= 256
137137
error_message = "The Google service account display name must be at most 100 characters"
138138
}
139139
}

0 commit comments

Comments
 (0)