Skip to content

Find SQS queues missing between environments

Each side has a queue the other does not.

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
Channels
! refunds-queue address — Queue refunds-queue is not on queues-prod. (queues-staging: refunds-queue)
+ audit-queue address — Queue audit-queue is not on queues-staging. (queues-prod: audit-queue)
Notes
- Queues-staging is account 300000000201 and queues-prod is account 300000000202; ARNs are compared by the name they end in.
Drift: 0 changed · 1 unmanaged · 1 missing (drift) — 7 matched

Exit code 2: drift found, so a CI job can stop here.

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)
Channels
! refunds-queue address — Queue refunds-queue does not exist. (document: refunds-queue)
+ audit-queue address — Queue audit-queue exists but no channel in the document describes it. (broker: audit-queue)
Drift: 0 changed · 1 unmanaged · 1 missing (drift) — 2 matched

Two documents (exit 2)

$ kurkik sqs diff staging.yaml prod.yaml
staging.yaml vs prod.yaml
AsyncAPI 3.0.0
Channels
! refunds-queue address — refunds-queue is in staging.yaml and not in prod.yaml. (staging.yaml: refunds-queue)
+ audit-queue address — audit-queue is in prod.yaml and not in staging.yaml. (prod.yaml: audit-queue)
Drift: 0 changed · 1 unmanaged · 1 missing (drift) — 1 matched

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-queue:
address: orders-queue
bindings:
sqs:
bindingVersion: 0.2.0
queue:
name: orders-queue
fifoQueue: false
deliveryDelay: 0
visibilityTimeout: 30
receiveMessageWaitTime: 0
messageRetentionPeriod: 345600
x-sqs-attributes:
MaximumMessageSize: 1048576
SqsManagedSseEnabled: true
refunds-queue:
address: refunds-queue
bindings:
sqs:
bindingVersion: 0.2.0
queue:
name: refunds-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: localhost:14566
protocol: amazon-sqs
description: Amazon SQS in us-east-1.
channels:
audit-queue:
address: audit-queue
bindings:
sqs:
bindingVersion: 0.2.0
queue:
name: audit-queue
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
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-queue
awslocal sqs create-queue --queue-name refunds-queue

queues-prod

Terminal window
awslocal sqs create-queue --queue-name orders-queue
awslocal sqs create-queue --queue-name audit-queue

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