rso_queue_webhook (Resource)¶
Push delivery: every message of a topic (matching the filter) or of a queue is POSTed to a URL.
A 2xx answer is success; anything else is retried with growing pauses and finally moved to the webhook's dead-letter queue. Delivery is at least once: the same message can arrive twice, with the same X-RSO-Delivery-Id. With a secret, each request carries an HMAC-SHA256 signature over the timestamp and the body.
Set exactly one of topic and queue. The URL must be https and resolve to a public address.
Example Usage¶
# Push every "order.*" message of a topic to a URL.
resource "rso_queue_webhook" "orders" {
name = "orders-hook"
topic = rso_topic.events.name
filter = "order.*"
url = "https://api.example.com/hooks/orders"
secret = var.webhook_secret
headers = {
Authorization = "Bearer ${var.hook_token}"
}
}
# Or drain a queue to a URL.
resource "rso_queue_webhook" "uploads" {
name = "uploads-hook"
queue = rso_queue.uploads.name
url = "https://api.example.com/hooks/uploads"
}
Schema¶
Required¶
name(String) Webhook name, unique within the tenant, up to 38 characters.url(String) Where to POST each message.
Optional¶
enabled(Boolean) Set tofalseto stop delivery; messages wait in the meantime.filter(String) Withtopic: pattern on the routing key (*one word,#any number). Every message when unset.headers(Map of String, Sensitive) Static headers sent with every request, for example anAuthorizationheader. Never read back.queue(String) Queue whose messages are delivered, as an alternative totopic. The webhook then consumes the queue.secret(String, Sensitive) Signing secret. Never read back from the platform.topic(String) Topic whose messages are delivered.rso-eventscarries the platform's events for the tenant.
Read-Only¶
dead_letter_queue(String) Queue that collects the messages that could not be delivered.id(String) Same asname.
Import¶
Import is supported using the following syntax:
# Import a webhook by its name. The signing secret and headers are not read back.
terraform import rso_queue_webhook.orders orders-hook