I need to create an eventarc trigger on a Pub/Sub message published. I do not know where to put the Pub/Sub topic ID.
resource "google_eventarc_trigger" "eventarc_trigger" {
name = "test-trigger"
service_account = var.service_account
project = local.project
location = local.region
destination {
workflow = google_workflows_workflow.example.id
}
matching_criteria {
attribute = "type"
value = "google.cloud.pubsub.topic.v1.messagePublished"
}
}
You can define the target transport like that
resource "google_eventarc_trigger" "eventarc_trigger" {
name = "test-trigger"
service_account = var.service_account
project = local.project
location = local.region
destination {
workflow = google_workflows_workflow.example.id
}
matching_criteria {
attribute = "type"
value = "google.cloud.pubsub.topic.v1.messagePublished"
}
transport {
pubsub {
topic = "projects/{PROJECT_ID}/topics/{TOPIC_NAME}"
}
}
}