Skip to content

Compare SQS queues across accounts and endpoints

Same queues, another account and another address.

Terminal recording of kurkik sqs diff

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

Terminal window
kurkik sqs diff queues-staging queues-prod
queues-staging vs queues-prod
Amazon SQS queues-prod
Notes
- Queues-staging is account 300000000901 and queues-prod is account 300000000902; ARNs are compared by the name they end in.
Drift: 0 changed · 0 unmanaged · 0 missing (no drift) — 23 matched

Exit code 0: no drift.

Mark Means
~ both sides have it, but it differs
! only the first side has it
+ only the second side has it

A document and a connection (exit 2)

$ kurkik sqs diff staging.yaml queues-prod
staging.yaml vs queues-prod
AsyncAPI 3.0.0 · Amazon SQS queues-prod (us-east-1)
Servers
! sqs host — Amazon SQS was read at 127.0.0.1:14566, not at localhost:14566. (document: localhost:14566, broker: 127.0.0.1:14566)
Drift: 0 changed · 0 unmanaged · 1 missing (drift) — 3 matched

Two documents (exit 0)

$ kurkik sqs diff staging.yaml prod.yaml
staging.yaml vs prod.yaml
AsyncAPI 3.0.0
Servers
- sqs host — Server 'sqs' (localhost:14566) has no counterpart in prod.yaml. (staging.yaml: localhost:14566)
- sqs host — Server 'sqs' (127.0.0.1:14566) has no counterpart in staging.yaml. (prod.yaml: 127.0.0.1:14566)
Drift: 0 changed · 0 unmanaged · 0 missing (no drift) — 3 matched · 2 not verifiable

Download the JSON report (-o json)

staging.yaml
asyncapi: 3.0.0
info:
title: queues-staging Amazon SQS API
version: 1.0.0-SNAPSHOT
description: Generated by reading Amazon SQS of queues-staging (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 staging.yaml

prod.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: 127.0.0.1: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 prod.yaml

How to build this setup yourself

queues-staging

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:300000000901:orders-dlq\", \"maxReceiveCount\": 5}"}'
awslocal sqs create-queue --queue-name payments-queue

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:300000000902:orders-dlq\", \"maxReceiveCount\": 5}"}'
awslocal sqs create-queue --queue-name payments-queue

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