File tree Expand file tree Collapse file tree 2 files changed +26
-21
lines changed Expand file tree Collapse file tree 2 files changed +26
-21
lines changed Original file line number Diff line number Diff line change 1+ resource "google_project_iam_member" "github_actions__roles" {
2+ for_each = toset (
3+ [
4+ " roles/iam.serviceAccountUser" ,
5+ " roles/pubsub.editor" ,
6+ " roles/errorreporting.writer" ,
7+ " roles/artifactregistry.writer" ,
8+ " roles/storage.objectAdmin" ,
9+ # Allows the GHA to call "namespaces get" for Cloud Run to determine the resulting run URLs of the services.
10+ # This should also allow a service to get its own name by using:
11+ # https://stackoverflow.com/questions/65628822/google-cloud-run-can-a-service-know-its-own-url/65634104#65634104
12+ " roles/run.developer" ,
13+ ]
14+ )
15+ project = var. google_cloud_project_id
16+ role = each. value
17+ member = " serviceAccount:${ google_service_account . github_actions_service_account . email } "
18+ depends_on = [time_sleep . wait_for_google_apis_to_enable ]
19+ }
20+
21+
22+ resource "google_storage_bucket_iam_member" "github_actions__default_bucket__storage__object_viewer" {
23+ bucket = google_storage_bucket. default . name
24+ role = " roles/storage.objectAdmin"
25+ member = google_service_account. github_actions_service_account . email
26+ }
Original file line number Diff line number Diff line change @@ -7,27 +7,6 @@ resource "google_service_account" "github_actions_service_account" {
77}
88
99
10- resource "google_project_iam_member" "github_actions__roles" {
11- for_each = toset (
12- [
13- " roles/iam.serviceAccountUser" ,
14- " roles/pubsub.editor" ,
15- " roles/errorreporting.writer" ,
16- " roles/artifactregistry.writer" ,
17- " roles/storage.objectAdmin" ,
18- # Allows the GHA to call "namespaces get" for Cloud Run to determine the resulting run URLs of the services.
19- # This should also allow a service to get its own name by using:
20- # https://stackoverflow.com/questions/65628822/google-cloud-run-can-a-service-know-its-own-url/65634104#65634104
21- " roles/run.developer" ,
22- ]
23- )
24- project = var. google_cloud_project_id
25- role = each. value
26- member = " serviceAccount:${ google_service_account . github_actions_service_account . email } "
27- depends_on = [time_sleep . wait_for_google_apis_to_enable ]
28- }
29-
30-
3110resource "google_service_account" "developers" {
3211 for_each = var. developer_service_account_names
3312 account_id = each. key
You can’t perform that action at this time.
0 commit comments