Skip to content

Commit bb1e4b0

Browse files
committed
setup resources in terraform
1 parent 45c2e32 commit bb1e4b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

infra/functions-python/main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,18 @@ resource "google_cloudfunctions2_function" "tasks_executor" {
12461246
}
12471247
}
12481248

1249+
# Create the Pub/Sub topic used for publishing messages about rebuilding missing bounding boxes
1250+
resource "google_pubsub_topic" "rebuild_missing_bounding_boxes" {
1251+
name = "rebuild-bounding-boxes-topic"
1252+
}
1253+
1254+
# Grant the Cloud Functions service account permission to publish messages to the rebuild-bounding-boxes-topic Pub/Sub topic
1255+
resource "google_pubsub_topic_iam_member" "rebuild_missing_bounding_boxes_publisher" {
1256+
topic = google_pubsub_topic.rebuild_bounding_boxes.name
1257+
role = "roles/pubsub.publisher"
1258+
member = "serviceAccount:${google_service_account.functions_service_account.email}"
1259+
}
1260+
12491261
# IAM entry for all users to invoke the function
12501262
resource "google_cloudfunctions2_function_iam_member" "tokens_invoker" {
12511263
project = var.project_id

0 commit comments

Comments
 (0)