Skip to content

Commit

Permalink
fix(deploy): ensure build_sa iams are set before it can be used
Browse files Browse the repository at this point in the history
Fixes possible race condition in cloud functions deployment where the
function build started before the build_sa had all its IAMs bound.
  • Loading branch information
nielm committed Sep 26, 2024
1 parent fe84d5c commit 66d63b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions terraform/modules/autoscaler-base/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@
output "build_sa_id" {
value = google_service_account.build_sa.id
description = "Service account ID for Builder SA"
depends_on = [ google_project_iam_binding.build_iam ]
depends_on = [
google_project_iam_binding.build_iam["roles/storage.objectViewer"],
google_project_iam_binding.build_iam["roles/logging.logWriter"],
google_project_iam_binding.build_iam["roles/artifactregistry.writer"]
]
}
output "build_sa_email" {
value = google_service_account.build_sa.email
description = "Service account email for Builder SA"
depends_on = [ google_project_iam_binding.build_iam ]
depends_on = [
google_project_iam_binding.build_iam["roles/storage.objectViewer"],
google_project_iam_binding.build_iam["roles/logging.logWriter"],
google_project_iam_binding.build_iam["roles/artifactregistry.writer"]
]
}

0 comments on commit 66d63b3

Please sign in to comment.