Skip to content

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 example application/json.
  • enabled (Boolean) Set to false to pause the schedule.
  • queue (String) Queue to publish to.
  • routing_key (String) With topic: the routing key subscriptions filter on.
  • topic (String) Topic to publish to, as an alternative to queue.

Read-Only

  • id (String) Same as name.

Import

Import is supported using the following syntax:

# Import a scheduled message by its name.
terraform import rso_scheduled_message.reindex nightly-reindex