Skip to content

Commit ddc8555

Browse files
authored
[CI] Add BigQuery JobUser role binding for querying operational metrics (#535)
This change reintroduces a BigQuery role binding that was removed in #525. Now that our CronJob is also querying past data to determine the number of unique LLVM contributors over time, we must grant the associated service account `roles/bigquery.JobUser` so that the BigQuery client can create query jobs. This is the error without this binding: ``` google.api_core.exceptions.Forbidden: 403 POST: Access Denied: User does not have bigquery.jobs.create permission in project llvm-premerge-checks. ```
1 parent 859653d commit ddc8555

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

premerge/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ resource "google_service_account" "operational_metrics_gsa" {
231231
display_name = "Operational Metrics GSA"
232232
}
233233

234+
resource "google_project_iam_binding" "bigquery_jobuser_binding" {
235+
project = google_service_account.operational_metrics_gsa.project
236+
role = "roles/bigquery.jobUser"
237+
238+
members = [
239+
"serviceAccount:${google_service_account.operational_metrics_gsa.email}",
240+
]
241+
242+
depends_on = [google_service_account.operational_metrics_gsa]
243+
}
244+
234245
resource "kubernetes_namespace" "operational_metrics" {
235246
metadata {
236247
name = "operational-metrics"

0 commit comments

Comments
 (0)