You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When defining ingress/egress policies using the ingress_policies/egress_policies variable of the VPC-SC module and by using the factory (defining a policy by creating a data/ingress-policies/my-policy.yaml file), Terraform throws an "Inconsistent conditional result types" error if one policy defines the identities parameter and the other one the indentity_type parameter.
Environment
# terraform -version
Terraform v1.9.8
on darwin_arm64
# git rev-parse --short HEAD
b85711e8
To Reproduce
To reproduce the error, you can modify one of the examples from the VPC-SC readme.
Prepare an access-levels and ingress-policies factory configuration like so:
Expected behavior
No terraform errors should be thrown when running terraform plan or terraform apply.
Result
Error: Inconsistent conditional result types
on fabric/modules/vpc-sc/service-perimeters-regular.tf line 217, in resource "google_access_context_manager_service_perimeter" "regular":
217: for_each = status.value.ingress_policies == null ? {} : {
218: for k in status.value.ingress_policies :
219: k => lookup(local.ingress_policies, k, null)
220: if contains(keys(local.ingress_policies), k)
221: }
├────────────────
│ local.ingress_policies is object with 2 attributes
│ status.value.ingress_policies is list of string with 2 elements
The false result value has the wrong type: attribute types must all match for
conversion to map.
Additional context
The error is caused by incorrect default values in the VPC-SC module when merging policies in modules/vpc-sc/factory.tf L52 and L72.
Since identities is of type list, the default value when merging should not be null but [] instead.
I will submit a PR with a potential fix and link it here.
PR: #2676
The text was updated successfully, but these errors were encountered:
Describe the bug
When defining ingress/egress policies using the
ingress_policies
/egress_policies
variable of the VPC-SC module and by using the factory (defining a policy by creating adata/ingress-policies/my-policy.yaml
file), Terraform throws an "Inconsistent conditional result types" error if one policy defines theidentities
parameter and the other one theindentity_type
parameter.Environment
To Reproduce
To reproduce the error, you can modify one of the examples from the VPC-SC readme.
access-levels
andingress-policies
factory configuration like so:data/access-levels/geo-it.yaml
data/ingress-policies/i2.yaml
Expected behavior
No terraform errors should be thrown when running
terraform plan
orterraform apply
.Result
Additional context
The error is caused by incorrect default values in the VPC-SC module when merging policies in
modules/vpc-sc/factory.tf
L52 and L72.Since
identities
is of type list, the default value when merging should not benull
but[]
instead.I will submit a PR with a potential fix and link it here.
PR: #2676
The text was updated successfully, but these errors were encountered: