-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Dataflow to Shared VPC API service accounts (#458)
- Loading branch information
1 parent
3954a89
commit 0c5adf3
Showing
8 changed files
with
34 additions
and
1 deletion.
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
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
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ locals { | |
apis = { | ||
"container.googleapis.com" : format("service-%[email protected]", data.google_project.service_project.number), | ||
"dataproc.googleapis.com" : format("service-%[email protected]", data.google_project.service_project.number), | ||
"dataflow.googleapis.com" : format("service-%[email protected]", data.google_project.service_project.number), | ||
} | ||
gke_shared_vpc_enabled = contains(var.active_apis, "container.googleapis.com") | ||
active_apis = setintersection(keys(local.apis), var.active_apis) | ||
|
@@ -31,7 +32,9 @@ locals { | |
/****************************************** | ||
if "container.googleapis.com" compute.networkUser role granted to GKE service account for GKE on shared VPC subnets | ||
if "dataproc.googleapis.com" compute.networkUser role granted to dataproc service account for dataproc on shared VPC subnets | ||
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 | ||
*****************************************/ | ||
resource "google_compute_subnetwork_iam_member" "service_shared_vpc_subnet_users" { | ||
provider = google-beta | ||
|
@@ -55,6 +58,7 @@ resource "google_compute_subnetwork_iam_member" "service_shared_vpc_subnet_users | |
/****************************************** | ||
if "container.googleapis.com" compute.networkUser role granted to GKE service account for GKE on shared VPC Project if no subnets defined | ||
if "dataproc.googleapis.com" compute.networkUser role granted to dataproc service account for dataproc on shared VPC Project if no subnets defined | ||
if "dataflow.googleapis.com" compute.networkUser role granted to dataflow service account for Dataflow 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 ? local.active_apis : [] | ||
|
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
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
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
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
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