rso_scheduled_message (Resource)¶
Publishes a fixed message to a queue or a topic on a cron schedule.
Each occurrence is published at least once; after downtime one late message is sent and the schedule continues. Set exactly one of queue and topic.
Example Usage¶
# Ask a worker to rebuild the search index every night at 03:00 UTC.
resource "rso_scheduled_message" "reindex" {
name = "nightly-reindex"
schedule = "0 3 * * *"
queue = rso_queue.jobs.name
body = jsonencode({ task = "reindex" })
content_type = "application/json"
}
Schema¶
Required¶
body(String) The message body.name(String) Name, unique within the tenant.schedule(String) Five-field cron expression (minute hour day month weekday), in UTC.
Optional¶
content_type(String) Content type of the body, for exampleapplication/json.enabled(Boolean) Set tofalseto pause the schedule.queue(String) Queue to publish to.routing_key(String) Withtopic: the routing key subscriptions filter on.topic(String) Topic to publish to, as an alternative toqueue.
Read-Only¶
id(String) Same asname.
Import¶
Import is supported using the following syntax:
# Import a scheduled message by its name.
terraform import rso_scheduled_message.reindex nightly-reindex