How Shared VPC subnets and IAM permissions are assigned
mainThe module manages access to Shared VPC networks using the roles/compute.networkUser role. The scope of this access depends on how you configure the input variables:
- No Access: If both
svpc_host_project_idandshared_vpc_subnetsare unset, nocompute.networkUserrole is assigned. - Full Host Access: If
svpc_host_project_idis set butshared_vpc_subnetsis not provided, thecompute.networkUserrole is assigned at the host project level. This gives the service project access to all shared VPC subnetworks. - Granular Subnet Access: If
svpc_host_project_idis set andshared_vpc_subnetscontains an array of subnetwork paths, thecompute.networkUserrole is assigned to each specific subnetwork in the array. This limits the service project's access only to those specified subnets.