Skip to content

Commit

Permalink
Grant TUF SA access to modify storage objects (#947)
Browse files Browse the repository at this point in the history
Needed to use the TUF SA on GitHub Actions workflows.

Signed-off-by: Hayden Blauzvern <[email protected]>
  • Loading branch information
haydentherapper authored Jan 19, 2024
1 parent 04ed71b commit 242e139
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions terraform/gcp/modules/tuf/tuf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ resource "google_storage_bucket_iam_member" "public_tuf_member" {
depends_on = [google_storage_bucket.tuf]
}

resource "google_storage_bucket_iam_member" "tuf_sa_editor" {
bucket = google_storage_bucket.tuf.name
role = "roles/storage.objectUser"
member = format("serviceAccount:%s@%s.iam.gserviceaccount.com", var.tuf_service_account_name, var.project_id)

depends_on = [google_storage_bucket.tuf, google_service_account.tuf-sa]
}

resource "google_storage_bucket" "tuf_preprod" {
name = var.tuf_preprod_bucket
location = var.region
Expand Down Expand Up @@ -119,3 +127,11 @@ resource "google_storage_bucket_iam_member" "public_tuf_preprod_member" {

depends_on = [google_storage_bucket.tuf_preprod]
}

resource "google_storage_bucket_iam_member" "tuf_sa_preprod_editor" {
bucket = google_storage_bucket.tuf_preprod.name
role = "roles/storage.objectUser"
member = format("serviceAccount:%s@%s.iam.gserviceaccount.com", var.tuf_service_account_name, var.project_id)

depends_on = [google_storage_bucket.tuf_preprod, google_service_account.tuf-sa]
}

0 comments on commit 242e139

Please sign in to comment.