Fix identity_type (#1978)

* Allow empty string for 'identity_type' supported by Google provider and use correct value name for ingress 'identity_type'

* Sanitizing variables as the logical operators in Terraform do not short-circuit.
This commit is contained in:
Viliam Pucik 2024-01-15 21:40:06 +01:00 committed by GitHub
parent eee6aaff2c
commit 19eb247849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ variable "egress_policies" {
for k, v in var.egress_policies :
v.from.identity_type == null || contains([
"IDENTITY_TYPE_UNSPECIFIED", "ANY_IDENTITY",
"ANY_USER_ACCOUNT", "ANY_SERVICE_ACCOUNT"
"ANY_USER_ACCOUNT", "ANY_SERVICE_ACCOUNT", ""
], coalesce(v.from.identity_type, "-"))
])
error_message = "Invalid `from.identity_type` value in egress policy."
@ -160,7 +160,7 @@ variable "ingress_policies" {
for k, v in var.ingress_policies :
v.from.identity_type == null || contains([
"IDENTITY_TYPE_UNSPECIFIED", "ANY_IDENTITY",
"ANY_USER", "ANY_SERVICE_ACCOUNT"
"ANY_USER_ACCOUNT", "ANY_SERVICE_ACCOUNT", ""
], coalesce(v.from.identity_type, "-"))
])
error_message = "Invalid `from.identity_type` value in ingress policy."