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
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
Terraform Version
Additional information
No response