-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added networkconnectivity in shared VPC host access (#876)
- Loading branch information
1 parent
7032b89
commit 0f12598
Showing
1 changed file
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ locals { | |
"vpcaccess.googleapis.com" : format("service-%[email protected]", local.service_project_number) | ||
"datastream.googleapis.com" : format("service-%[email protected]", local.service_project_number) | ||
"notebooks.googleapis.com" : format("service-%[email protected]", local.service_project_number) | ||
"networkconnectivity.googleapis.com" : format("service-%[email protected]", local.service_project_number) | ||
} | ||
gke_shared_vpc_enabled = contains(var.active_apis, "container.googleapis.com") | ||
composer_shared_vpc_enabled = contains(var.active_apis, "composer.googleapis.com") | ||
|
@@ -46,6 +47,8 @@ locals { | |
if "dataflow.googleapis.com" compute.networkUser role granted to dataflow service account for Dataflow on shared VPC subnets | ||
if "composer.googleapis.com" compute.networkUser role granted to composer service account for Composer on shared VPC subnets | ||
if "notebooks.googleapis.com" compute.networkUser role granted to notebooks service account for Notebooks on shared VPC Project | ||
if "networkconnectivity.googleapis.com" compute.networkUser role granted to notebooks service account for Network Connectivity on shared VPC Project | ||
See: https://cloud.google.com/vpc/docs/configure-service-connection-policies#configure-host-project | ||
See: https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-shared-vpc | ||
https://cloud.google.com/dataflow/docs/concepts/security-and-permissions#cloud_dataflow_service_account | ||
https://cloud.google.com/composer/docs/how-to/managing/configuring-shared-vpc | ||
|
@@ -100,6 +103,7 @@ resource "google_compute_subnetwork_iam_member" "cloudservices_shared_vpc_subnet | |
if "dataflow.googleapis.com" compute.networkUser role granted to dataflow service account for Dataflow on shared VPC Project if no subnets defined | ||
if "composer.googleapis.com" compute.networkUser role granted to composer service account for Composer on shared VPC Project if no subnets defined | ||
if "notebooks.googleapis.com" compute.networkUser role granted to notebooks service account for Notebooks on shared VPC Project if no subnets defined | ||
if "networkconnectivity.googleapis.com" compute.networkUser role granted to notebooks service account for Notebooks on shared VPC Project if no subnets defined | ||
*****************************************/ | ||
resource "google_project_iam_member" "service_shared_vpc_user" { | ||
for_each = (length(var.shared_vpc_subnets) == 0) && var.enable_shared_vpc_service_project && var.grant_network_role ? toset(local.active_apis) : [] | ||
|