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

Shared VPC granting is broken #97

Closed
morgante opened this issue Jan 10, 2019 · 2 comments
Closed

Shared VPC granting is broken #97

morgante opened this issue Jan 10, 2019 · 2 comments

Comments

@morgante
Copy link
Contributor

In #72, we messed up the logic for granting networkUser permission.

There are meant to be 3 different conditions.

  1. No shared_vpc and no subnets => no grants
  2. shared_vpc and no subnets => grant to the project (all networks/subnets)
  3. shared_vpc and subnets => grant to the subnets (and not to the project)
@leone145
Copy link

leone145 commented Mar 1, 2019

I have verified on our end that the fix listed does correct the condition of not adding the group_name to the project level if condition 3 is met. However group_name does not get cleaned up from the shared subnet on project destroy.

glarizza added a commit to glarizza/terraform-google-project-factory that referenced this issue Mar 7, 2019
This commit addresses issue terraform-google-modules#97
(terraform-google-modules#97)
and updates the logic around IAM bindings with regard to shared VPC
subnets. The logic is as follows:

1. If `var.shared_vpc` and `var.shared_vpc_subnets` are empty no
   bindings are mad
2. If `var.shared_vpc` is set but no subnets are provided with
   `var.shared_vpc_subnets` then the IAM bindings are set at the Host
   Project
3. If `var.shared_vpc` is set and `var.shared_vpc_subnets` contains
   subnets then the IAM bindings are granted on the subnetworks
   themselve

This commit updates the logic used to calculate the Host Project
bindings based on scenario 3 above. The tests have also been modified to
ensure that those bindings AREN'T set.
glarizza added a commit to glarizza/terraform-google-project-factory that referenced this issue Mar 7, 2019
This commit addresses issue terraform-google-modules#97
(terraform-google-modules#97)
and updates the logic around IAM bindings with regard to shared VPC
subnets. The logic is as follows:

1. If `var.shared_vpc` and `var.shared_vpc_subnets` are empty no
   bindings are mad
2. If `var.shared_vpc` is set but no subnets are provided with
   `var.shared_vpc_subnets` then the IAM bindings are set at the Host
   Project
3. If `var.shared_vpc` is set and `var.shared_vpc_subnets` contains
   subnets then the IAM bindings are granted on the subnetworks
   themselve

This commit updates the logic used to calculate the Host Project
bindings based on scenario 3 above. The tests have also been modified to
ensure that those bindings AREN'T set.
glarizza added a commit to glarizza/terraform-google-project-factory that referenced this issue Mar 8, 2019
This commit addresses issue terraform-google-modules#97
(terraform-google-modules#97)
and updates the logic around IAM bindings with regard to shared VPC
subnets. The logic is as follows:

1. If `var.shared_vpc` and `var.shared_vpc_subnets` are empty no
   bindings are mad
2. If `var.shared_vpc` is set but no subnets are provided with
   `var.shared_vpc_subnets` then the IAM bindings are set at the Host
   Project
3. If `var.shared_vpc` is set and `var.shared_vpc_subnets` contains
   subnets then the IAM bindings are granted on the subnetworks
   themselve

This commit updates the logic used to calculate the Host Project
bindings based on scenario 3 above. The tests have also been modified to
ensure that those bindings AREN'T set.
@aaron-lane
Copy link
Contributor

Fixed by #164.

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

No branches or pull requests

3 participants