rso_topic_subscription (Resource)¶
Delivers a topic's messages into a queue. Every argument forces a new subscription.
To push a topic's messages to a URL use rso_queue_webhook.
Example Usage¶
# Messages published to the topic with a routing key such as "order.created"
# are copied into the queue.
resource "rso_topic_subscription" "orders" {
topic = rso_topic.events.name
queue = rso_queue.orders.name
filter = "order.*"
}
# The platform's own events for the tenant (apps deployed, access changed, ...)
# arrive on the reserved topic "rso-events".
resource "rso_topic_subscription" "audit" {
topic = "rso-events"
queue = rso_queue.audit.name
}
Schema¶
Required¶
queue(String) Queue that receives the messages.topic(String) Topic to read from.rso-eventscarries the platform's events for the tenant.
Optional¶
filter(String) Pattern on the routing key a message was published with: dot-separated words,*for exactly one word,#for any number. Defaults to#, every message.
Read-Only¶
id(String) Subscription id, derived from the topic, the queue and the filter.
Import¶
Import is supported using the following syntax:
# Import a subscription by its id.
terraform import rso_topic_subscription.orders 53f9970cf097