From 8313027702c75e1f14f185acdb53ee65942ffd3e Mon Sep 17 00:00:00 2001 From: Michelle Shepardson Date: Fri, 4 Oct 2024 18:54:02 +0000 Subject: [PATCH] Add a subscription to gs://kubernetes-ci-logs. There's an existing PubSub topic for GCS changes to gs://kubernetes-ci-logs (in k8s-infra-prow). Attempt to add a new subscription to this in kubernetes-public so Kettle can use updates from the new logs bucket. (Note: I don't have permissions to run terraform here, so I haven't verified that these additions are valid.) --- .../terraform/kubernetes-public/k8s-kettle.tf | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/infra/gcp/terraform/kubernetes-public/k8s-kettle.tf b/infra/gcp/terraform/kubernetes-public/k8s-kettle.tf index 3c4d103ee00..07269a71483 100644 --- a/infra/gcp/terraform/kubernetes-public/k8s-kettle.tf +++ b/infra/gcp/terraform/kubernetes-public/k8s-kettle.tf @@ -95,3 +95,26 @@ resource "google_pubsub_subscription_iam_binding" "subscription_binding" { "serviceAccount:${module.aaa_kettle_sa.email}" ] } + +// Create a subscription in this project to the kubernetes-ci-logs-updates topic in k8s-infra-prow. +data "google_pubsub_topic" "kubernetes_ci_logs_topic" { + name = "kubernetes-ci-logs-updates" + project = "k8s-infra-prow" +} + +resource "google_pubsub_subscription" "kettle_ci_logs_subscription" { + name = "k8s-infra-kettle" + topic = data.google_pubsub_topic.kubernetes_ci_logs_topic.name + project = data.google_project.project.project_id + + filter = "attributes.eventType = \"OBJECT_FINALIZE\"" +} + +resource "google_pubsub_subscription_iam_binding" "ci_logs_subscription_binding" { + project = data.google_project.project.project_id + subscription = google_pubsub_subscription.kettle_ci_logs_subscription.name + role = "roles/pubsub.editor" + members = [ + "serviceAccount:${module.aaa_kettle_sa.email}" + ] +}