terraform-google-modules / terraform-google-vpc-service-controls

Handles opinionated VPC Service Controls and Access Context Manager configuration and deployments
https://registry.terraform.io/modules/terraform-google-modules/vpc-service-controls/google
Apache License 2.0
59 stars 67 forks source link

Terraform Regular Service Perimeter Failing with version 6.0.0 upgrade #140

Open ankitsr92 opened 2 months ago

ankitsr92 commented 2 months ago

TL;DR

Terraform Plan is failing with the new release 6.0.0 changes. Error, Error: Invalid index │ │ on .terraform/modules//modules/regular_service_perimeter/main.tf line 87, in resource "google_access_context_manager_service_perimeter" "regular_service_perimeter": │ 87: source_restriction = egress_policies.value["from"]["sources"] != null ? "SOURCE_RESTRICTION_ENABLED" : null │ ├──────────────── │ │ egress_policies.value["from"] is object with 2 attributes │ │ The given key does not identify an element in this collection value.

Error: Invalid index │ │ on .terraform/modules//modules/regular_service_perimeter/main.tf line 82, in resource "google_access_context_manager_service_perimeter" "regular_service_perimeter": │ 82: for_each = { for k, v in lookup(egress_policies.value["from"]["sources"], "access_levels", []) : v => "access_level" } │ ├──────────────── │ │ egress_policies.value["from"] is object with 2 attributes │ │ The given key does not identify an element in this collection value.

Expected behavior

Terraform Plan should work as it is working for previous version 5.2.1

Observed behavior

No response

Terraform Configuration

egress_policies =  [

    {
      "from" = { "identity_type" = "ANY_IDENTITY",
        "identities" = []
      }
      "to" = { "resources" = formatlist("projects/%s", var.project_ids),
        "operations" = { "*" = { "methods" = ["*"] }
        }
      }
    }]

Terraform Version

1.3.0

Additional information

No response

github-actions[bot] commented 6 days ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days