Skip to content

Commit

Permalink
Merge pull request #7266 from michelle192837/notification
Browse files Browse the repository at this point in the history
Fix GCS notification terraform.
  • Loading branch information
k8s-ci-robot committed Sep 5, 2024
2 parents aa5946b + ebf2481 commit 1985a86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infra/gcp/terraform/k8s-infra-prow/buckets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module "prow_bucket" {
resource "google_storage_notification" "notification" {
bucket = module.prow_bucket.name
payload_format = "JSON_API_V1"
topic = google_pubsub_topic.kubernetes_ci_logs_topic.name
topic = google_pubsub_topic.kubernetes_ci_logs_topic.id
depends_on = [google_pubsub_topic_iam_binding.publish_binding]
}

Expand Down
2 changes: 2 additions & 0 deletions infra/gcp/terraform/k8s-infra-prow/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ data "google_storage_project_service_account" "gcs_account" {
// Bind storage SA to publish to PubSub.
resource "google_pubsub_topic_iam_binding" "publish_binding" {
topic = google_pubsub_topic.kubernetes_ci_logs_topic.name
project = module.project.project_id
role = "roles/pubsub.publisher"
members = ["serviceAccount:${data.google_storage_project_service_account.gcs_account.email_address}"]
}

// Also bind TestGrid and Kettle as subscribers of this topic.
resource "google_pubsub_topic_iam_binding" "read_binding" {
topic = google_pubsub_topic.kubernetes_ci_logs_topic.name
project = module.project.project_id
role = "roles/pubsub.subscriber"
members = [
"serviceAccount:testgrid-canary@k8s-testgrid.iam.gserviceaccount.com",
Expand Down

0 comments on commit 1985a86

Please sign in to comment.