Skip to content

Commit 7112a5e

Browse files
authored
Revert "regional-go-service: grant compute.networkUser to Cloud Run service account." (#85)
Reverts #82 This is the wrong service account to receive this grant, so rolling this back.
1 parent 4f551d3 commit 7112a5e

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

modules/regional-go-service/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ No requirements.
8383
| [cosign_sign.this](https://registry.terraform.io/providers/chainguard-dev/cosign/latest/docs/resources/sign) | resource |
8484
| [google-beta_google_cloud_run_v2_service.this](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/google_cloud_run_v2_service) | resource |
8585
| [google_cloud_run_v2_service_iam_member.public-services-are-unauthenticated](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service_iam_member) | resource |
86-
| [google_compute_subnetwork_iam_member.member](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_subnetwork_iam_member) | resource |
8786
| [ko_build.this](https://registry.terraform.io/providers/ko-build/ko/latest/docs/resources/build) | resource |
8887

8988
## Inputs
@@ -94,7 +93,6 @@ No requirements.
9493
| <a name="input_egress"></a> [egress](#input\_egress) | The egress mode for the service. Must be one of ALL\_TRAFFIC, or PRIVATE\_RANGES\_ONLY. Egress traffic is routed through the regional VPC network from var.regions. | `string` | `"ALL_TRAFFIC"` | no |
9594
| <a name="input_ingress"></a> [ingress](#input\_ingress) | The ingress mode for the service. Must be one of INGRESS\_TRAFFIC\_ALL, INGRESS\_TRAFFIC\_INTERNAL\_LOAD\_BALANCER, or INGRESS\_TRAFFIC\_INTERNAL\_ONLY. | `string` | `"INGRESS_TRAFFIC_INTERNAL_ONLY"` | no |
9695
| <a name="input_name"></a> [name](#input\_name) | n/a | `string` | n/a | yes |
97-
| <a name="input_network_project"></a> [network\_project](#input\_network\_project) | (optional) The project in which the network and subnetworks reside. | `string` | `null` | no |
9896
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
9997
| <a name="input_regions"></a> [regions](#input\_regions) | A map from region names to a network and subnetwork. A pub/sub topic and ingress service (publishing to the respective topic) will be created in each region, with the ingress service configured to egress all traffic via the specified subnetwork. | <pre>map(object({<br> network = string<br> subnet = string<br> }))</pre> | n/a | yes |
10098
| <a name="input_service_account"></a> [service\_account](#input\_service\_account) | The service account as which to run the service. | `string` | n/a | yes |

modules/regional-go-service/main.tf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,3 @@ resource "google_cloud_run_v2_service_iam_member" "public-services-are-unauthent
155155
role = "roles/run.invoker"
156156
member = "allUsers"
157157
}
158-
159-
// Grant service account access to use subnet. This is typically granted with roles/run.serviceAgent,
160-
// but that role does not necessarily grant access if the network resides in another project.
161-
// See https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#direct-vpc-service for more details.
162-
resource "google_compute_subnetwork_iam_member" "member" {
163-
for_each = var.regions
164-
165-
// If not set, provider project should be used.
166-
project = var.network_project
167-
region = each.key
168-
subnetwork = each.value.subnet
169-
role = "roles/compute.networkUser"
170-
member = "serviceAccount:${var.service_account}"
171-
}

modules/regional-go-service/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,3 @@ variable "volumes" {
8888
}))
8989
default = []
9090
}
91-
92-
variable "network_project" {
93-
description = "(optional) The project in which the network and subnetworks reside."
94-
type = string
95-
default = null
96-
}

0 commit comments

Comments
 (0)