Skip to content

Commit

Permalink
Proper validation of empty string value in identity_type (#1980)
Browse files Browse the repository at this point in the history
  • Loading branch information
viliampucik authored Jan 16, 2024
1 parent 834269b commit 5372361
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/vpc-sc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ variable "egress_policies" {
validation {
condition = alltrue([
for k, v in var.egress_policies :
v.from.identity_type == null || contains([
v.from.identity_type == null ? true : contains([
"IDENTITY_TYPE_UNSPECIFIED", "ANY_IDENTITY",
"ANY_USER_ACCOUNT", "ANY_SERVICE_ACCOUNT", ""
], coalesce(v.from.identity_type, "-"))
], v.from.identity_type)
])
error_message = "Invalid `from.identity_type` value in egress policy."
}
Expand Down Expand Up @@ -158,10 +158,10 @@ variable "ingress_policies" {
validation {
condition = alltrue([
for k, v in var.ingress_policies :
v.from.identity_type == null || contains([
v.from.identity_type == null ? true : contains([
"IDENTITY_TYPE_UNSPECIFIED", "ANY_IDENTITY",
"ANY_USER_ACCOUNT", "ANY_SERVICE_ACCOUNT", ""
], coalesce(v.from.identity_type, "-"))
], v.from.identity_type)
])
error_message = "Invalid `from.identity_type` value in ingress policy."
}
Expand Down

0 comments on commit 5372361

Please sign in to comment.