Skip to content
Latchkey

aws sqs send-message: Send to an SQS Queue in CI

Enqueue a message onto a standard or FIFO SQS queue.

aws sqs send-message places a message on an SQS queue identified by its URL. In CI it triggers async workers - kicking off a backfill, notifying a pipeline, or injecting a test message for an integration check.

Common flags

  • --queue-url - the full queue URL (required)
  • --message-body - the message payload (required)
  • --message-group-id - required for FIFO queues
  • --message-deduplication-id - dedup key for FIFO without content dedup
  • --delay-seconds - delay delivery (standard queues)

Example in CI

Trigger a background job after a deploy.

shell
aws sqs send-message --queue-url ${JOB_QUEUE_URL} --message-body '{"task":"backfill"}'

Common errors in CI

  • An error occurred (AWS.SimpleQueueService.NonExistentQueue) - wrong queue URL or region
  • The request must contain the parameter MessageGroupId - FIFO queue needs --message-group-id
  • An error occurred (AccessDenied) - role lacks sqs:SendMessage

Key takeaways

  • You address the queue by its full URL, not just the name.
  • FIFO queues require --message-group-id (and often a dedup id).
  • NonExistentQueue almost always means a region mismatch with the URL.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →