runr_topic (Resource)
A fan-out topic of the organization (topics): an event published to it (runr topics publish, POST /api/topics/{topic}/publish) reaches every project with a topic trigger on it (runr_project.triggers). The region needs Redis. A topic with subscribing triggers cannot be destroyed: remove the triggers first.
Import: terraform import runr_topic.orders orders (name or id).
Example Usage#
resource "runr_topic" "orders" {
name = "orders"
region_id = data.runr_region.eu.id
description = "Every order event"
}
# A project subscribes to it with a topic trigger.
resource "runr_project" "billing" {
name = "billing"
type = "faas"
runtime = "python"
region_id = data.runr_region.eu.id
triggers = [
{ name = "orders", type = "topic", config = jsonencode({ topic = runr_topic.orders.name }) },
]
}
Schema#
Required#
name(String) Name, unique in the organization (letters, digits and. _ -, at most 100). Changing it creates a new topic.region_id(String) Region whose Redis carries the topic. Changing it creates a new topic.
Optional#
description(String) Free text (at most 500 characters).
Read-Only#
id(String) Topic id.stream(String) The topic's Redis stream.
Import#
Import is supported using the following syntax:
The terraform import command can be used, for example:
# A topic is imported by name or id.
terraform import runr_topic.orders orders