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

Projects not remove from the perimeter if they are moved out of the folder #120

Closed Manouchka94 closed 8 months ago

Manouchka94 commented 11 months ago

TL;DR

When I move projets out of the quarantine folder they are not removed from the perimeter. More precisely, the Resources to protect value in the VPC Service Perimeter is not correctly updated by the module terraform-google-modules/vpc-service-controls/google//modules/regular_service_perimeter

Expected behavior

I expect the Cloud function remove the project from the VPC Service Perimeter list using terraform

I can see in the Cloud function that the module uses resource "google_access_context_manager_service_perimeter_resource" to update the resource projet list cloud-function-terraform-apply-release-project-from-quarantine

But when I use the terraform state show on the resource 'module.service_perimeter.google_access_context_manager_service_perimeter.regular_service_perimeter' I can see that the resources list still contains my project to protect. terraform-show-vpc-service-perimeter-properties

Observed behavior

The resource "google_access_context_manager_service_perimeter_resource" "service_perimeter_resource" used in this module https://github.com/terraform-google-modules/terraform-google-vpc-service-controls/blob/v5.0.0/modules/regular_service_perimeter/main.tf#L210 should be able to update the resources control list.

Terraform Configuration

terraform {
  required_version = ">= 1.3"
  required_providers {
    archive = {
      source  = "hashicorp/archive"
      version = "~> 2.0"
    }
    google = {
      source  = "hashicorp/google"
      version = ">= 3.0, < 5.0"
    }
    random = {
      source  = "hashicorp/random"
      version = "~> 3.0"
    }
  }
}

Terraform Version

# Version of Terraform that we're using
TERRAFORM_VERSION = '1.3.9'

Additional information

No response

github-actions[bot] commented 9 months 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