Skip to content

Commit 1f134f3

Browse files
authored
Add support for more services to github-ci-bootstrap (#18)
## Summary: This adds support for a few new services that are used by github-actions-runners deployments. Issue: INFRA-10749 ## Test plan: Update github-actions-runners to use this, apply the changes, and test with PR checks. Author: jwbron Reviewers: csilvers Required Reviewers: Approved By: csilvers Checks: ✅ 2 checks were successful Pull Request URL: #18
1 parent 2e2c0d6 commit 1f134f3

2 files changed

Lines changed: 26 additions & 14 deletions

File tree

terraform/modules/github-ci-bootstrap/main.tf

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,30 @@ terraform {
1515
# Define service-to-role mapping
1616
locals {
1717
read_write_roles = {
18-
cloudfunctions = "roles/cloudfunctions.admin"
19-
storage = "roles/storage.admin"
20-
pubsub = "roles/pubsub.admin"
21-
scheduler = "roles/cloudscheduler.admin"
22-
run = "roles/run.admin"
23-
cloudbuild = "roles/cloudbuild.builds.builder"
18+
cloudfunctions = "roles/cloudfunctions.admin"
19+
storage = "roles/storage.admin"
20+
pubsub = "roles/pubsub.admin"
21+
scheduler = "roles/cloudscheduler.admin"
22+
run = "roles/run.admin"
23+
cloudbuild = "roles/cloudbuild.admin"
24+
artifactregistry = "roles/artifactregistry.admin"
25+
secretmanager = "roles/secretmanager.admin"
26+
logging = "roles/logging.admin"
27+
monitoring = "roles/monitoring.admin"
2428
}
2529

2630
# Read-only roles for any branch
2731
read_only_roles = {
28-
cloudfunctions = "roles/cloudfunctions.viewer"
29-
storage = "roles/storage.objectViewer"
30-
pubsub = "roles/pubsub.viewer"
31-
scheduler = "roles/cloudscheduler.viewer"
32-
run = "roles/run.viewer"
33-
cloudbuild = "roles/cloudbuild.builds.builder" # Read-only branches still need build access
32+
cloudfunctions = "roles/cloudfunctions.viewer"
33+
storage = "roles/storage.objectViewer"
34+
pubsub = "roles/pubsub.viewer"
35+
scheduler = "roles/cloudscheduler.viewer"
36+
run = "roles/run.viewer"
37+
cloudbuild = "roles/cloudbuild.viewer" # Read-only branches get viewer access
38+
artifactregistry = "roles/artifactregistry.reader"
39+
secretmanager = "roles/secretmanager.viewer"
40+
logging = "roles/logging.viewer"
41+
monitoring = "roles/monitoring.viewer"
3442
}
3543

3644
# Parse GitHub repository into org and repo name

terraform/modules/github-ci-bootstrap/variables.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ variable "target_projects" {
3333
"pubsub",
3434
"scheduler",
3535
"run",
36-
"cloudbuild"
36+
"cloudbuild",
37+
"artifactregistry",
38+
"secretmanager",
39+
"logging",
40+
"monitoring"
3741
], service)
3842
]
3943
]))
40-
error_message = "Required services must be one of: cloudfunctions, storage, pubsub, scheduler, run, cloudbuild."
44+
error_message = "Required services must be one of: cloudfunctions, storage, pubsub, scheduler, run, cloudbuild, artifactregistry, secretmanager, logging, monitoring."
4145
}
4246
}
4347

0 commit comments

Comments
 (0)