Skip to content

Commit

Permalink
feat: Give VPC Access Agent Service Account for Cloud Run permissions…
Browse files Browse the repository at this point in the history
… on Shared VPC (#615)

* Grant compute.networkUser role to Serverless VPC Access Service Agent

* update comments
  • Loading branch information
derhally authored Sep 10, 2021
1 parent f99972c commit 87d2df0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/shared_vpc_access/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ locals {
"dataproc.googleapis.com" : format("service-%s@dataproc-accounts.iam.gserviceaccount.com", local.service_project_number),
"dataflow.googleapis.com" : format("service-%s@dataflow-service-producer-prod.iam.gserviceaccount.com", local.service_project_number),
"composer.googleapis.com" : format("service-%s@cloudcomposer-accounts.iam.gserviceaccount.com", local.service_project_number)
"vpcaccess.googleapis.com" : format("service-%s@gcp-sa-vpcaccess.iam.gserviceaccount.com", 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")
Expand All @@ -39,6 +40,8 @@ locals {
if "dataflow.googleapis.com" compute.networkUser role granted to dataflow service account for Dataflow on shared VPC subnets
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
if "vpcaccess.googleapis.com" compute.networkUser role granted to Serverless VPC Access Service Agent on shared VPC subnets
See: https://cloud.google.com/run/docs/configuring/connecting-shared-vpc#grant-permissions
*****************************************/
resource "google_compute_subnetwork_iam_member" "service_shared_vpc_subnet_users" {
provider = google-beta
Expand Down

0 comments on commit 87d2df0

Please sign in to comment.