Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with submodule - fabric-net-svpc-access, when we try to remove/detach a service project. #317

Closed
nikhilmakhijani opened this issue Sep 24, 2021 · 0 comments · Fixed by #329

Comments

@nikhilmakhijani
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Affected Resource(s)

  • google_compute_shared_vpc_service_project

Terraform Configuration Files

  1. main.tf
    module "shared_vpc_access" {
    source = "terraform-google-modules/network/google//modules/fabric-net-svpc-access"
    version = "~> 3.4.0"
    for_each = var.shared_vpc_access_list
    host_project_id = each.value.host_project_id
    service_project_num = length(each.value.service_project_ids)
    service_project_ids = each.value.service_project_ids
    }

  2. variables.tf
    variable "shared_vpc_access_list" {
    description = "List of shared vpcs"
    type = map(object({
    host_project_id = string
    service_project_ids = list(string)
    }))
    }

  3. terraform.tfvars
    shared_vpc_access_list = {
    test = {
    host_project_id = "test-host-prj"
    service_project_ids = ["dev-prj","prod-prj"]
    }
    }

Expected Behavior

It should be able to attach and detach projects without impacting other projects mentioned in the service_project_ids list.

Actual Behavior

When we try to remove/detach a service project -:
Case 1. If we detach last service project in the list - It works fine
Case 2. If we detach service project from anywhere else on the list - it tries to detach then re-attach all the service projects mentioned after the service project which we detached/removed from the list.

For example:-
In the tfvars file above, we have two service projects in the list - 1) dev-prj 2) prod-prj . If we try to detach **dev-prj ** it will detach prod-prj as well then re-attach it.

Terraform Plan output - Plan: 1 to add, 0 to change, 2 to destroy.

Steps to Reproduce

  • Terraform apply

Looping in team - @maitreya-source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant