Skip to content

Export SQS dead-letter queues to AsyncAPI

The redrive policy goes into the queue binding.

Terminal recording of kurkik sqs export

The recording shows kurkik sqs export on the demo sandbox; its data differs from this example.

Terminal window
kurkik sqs export queues-prod --stdout
asyncapi.yaml
asyncapi: 3.0.0
info:
title: queues-prod Amazon SQS API
version: 1.0.0-SNAPSHOT
description: Generated by reading Amazon SQS of queues-prod (us-east-1).
servers:
sqs:
host: localhost:14566
protocol: amazon-sqs
description: Amazon SQS in us-east-1.
channels:
orders-dlq:
address: orders-dlq
bindings:
sqs:
bindingVersion: 0.2.0
queue:
name: orders-dlq
fifoQueue: false
deliveryDelay: 0
visibilityTimeout: 30
receiveMessageWaitTime: 0
messageRetentionPeriod: 345600
x-sqs-attributes:
MaximumMessageSize: 1048576
SqsManagedSseEnabled: true
orders-queue:
address: orders-queue
bindings:
sqs:
bindingVersion: 0.2.0
queue:
name: orders-queue
fifoQueue: false
deliveryDelay: 0
visibilityTimeout: 30
receiveMessageWaitTime: 0
messageRetentionPeriod: 345600
redrivePolicy:
deadLetterQueue:
name: orders-dlq
maxReceiveCount: 5
x-sqs-attributes:
MaximumMessageSize: 1048576
SqsManagedSseEnabled: true
payments-queue:
address: payments-queue
bindings:
sqs:
bindingVersion: 0.2.0
queue:
name: payments-queue
fifoQueue: false
deliveryDelay: 0
visibilityTimeout: 30
receiveMessageWaitTime: 0
messageRetentionPeriod: 345600
x-sqs-attributes:
MaximumMessageSize: 1048576
SqsManagedSseEnabled: true
operations: {}

Download asyncapi.yaml

How to build this setup yourself

queues-prod

Terminal window
awslocal sqs create-queue --queue-name orders-dlq
awslocal sqs create-queue --queue-name orders-queue --attributes '{"RedrivePolicy": "{\"deadLetterTargetArn\": \"arn:aws:sqs:us-east-1:400000000501:orders-dlq\", \"maxReceiveCount\": 5}"}'
awslocal sqs create-queue --queue-name payments-queue

All flags: kurkik sqs export · more Amazon SQS export examples