Compare SNS to SQS subscription settings
Filter policies, raw delivery and redrive policies.

The recording shows kurkik sns diff on the demo sandbox; its data differs from this example.
Command
Section titled “Command”kurkik sns diff topics-staging topics-prod --consumersOutput
Section titled “Output”topics-staging vs topics-prodAmazon SNS topics-prod
Subscriptions ~ orders subscription.filterPolicy — sqs:billing-queue: filterPolicy differs. (topics-staging: {"status": ["paid"]}, topics-prod: {"status": ["created"]}) ~ orders subscription.rawMessageDelivery — sqs:billing-queue: rawMessageDelivery differs. (topics-staging: true, topics-prod: false) ~ orders subscription.redrivePolicy.deadLetterQueue — sqs:billing-queue: redrivePolicy.deadLetterQueue differs. (topics-staging: orders-dlq, topics-prod: failed-orders)
Notes - Topics-staging is account 300000001501 and topics-prod is account 300000001502; ARNs are compared by the name they end in.
Drift: 3 changed · 0 unmanaged · 0 missing (drift) — 3 matchedExit 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 |
Other ways to give a side
Section titled “Other ways to give a side”A document and a connection (exit 2)
$ kurkik sns diff staging.yaml topics-prod --consumersstaging.yaml vs topics-prodAsyncAPI 3.0.0 · Amazon SNS topics-prod (us-east-1)
Subscriptions ! orders subscription — Subscription sqs:arn:aws:sqs:us-east-1:300000001501:billing-queue does not exist. (document: sqs:arn:aws:sqs:us-east-1:300000001501:billing-queue) + orders subscription — Subscription sqs:arn:aws:sqs:us-east-1:300000001502:billing-queue exists but is not declared by the document. (broker: sqs:arn:aws:sqs:us-east-1:300000001502:billing-queue)
Drift: 0 changed · 1 unmanaged · 1 missing (drift) — 2 matchedTwo documents (exit 0)
$ kurkik sns diff staging.yaml prod.yaml --consumersstaging.yaml vs prod.yamlAsyncAPI 3.0.0
Drift: 0 changed · 0 unmanaged · 0 missing (no drift) — 2 matchedDownload the JSON report (-o json)
The documents compared
Section titled “The documents compared”staging.yaml
asyncapi: 3.0.0info: title: topics-staging Amazon SNS API version: 1.0.0-SNAPSHOT description: Generated by reading Amazon SNS of topics-staging (us-east-1).servers: sns: host: localhost:14566 protocol: amazon-sns description: Amazon SNS in us-east-1.channels: orders: address: orders bindings: sns: bindingVersion: 0.1.0 name: orders ordering: type: standardoperations: receive_from_orders: action: receive channel: $ref: "#/channels/orders" description: Subscriptions of orders when this document was generated. bindings: sns: bindingVersion: 0.1.0 consumers: - protocol: sqs endpoint: arn: arn:aws:sqs:us-east-1:300000001501:billing-queue filterPolicy: status: - paid filterPolicyScope: MessageAttributes rawMessageDelivery: true redrivePolicy: deadLetterTargetArn: arn:aws:sqs:us-east-1:300000001501:orders-dlqprod.yaml
asyncapi: 3.0.0info: title: topics-prod Amazon SNS API version: 1.0.0-SNAPSHOT description: Generated by reading Amazon SNS of topics-prod (us-east-1).servers: sns: host: localhost:14566 protocol: amazon-sns description: Amazon SNS in us-east-1.channels: orders: address: orders bindings: sns: bindingVersion: 0.1.0 name: orders ordering: type: standardoperations: receive_from_orders: action: receive channel: $ref: "#/channels/orders" description: Subscriptions of orders when this document was generated. bindings: sns: bindingVersion: 0.1.0 consumers: - protocol: sqs endpoint: arn: arn:aws:sqs:us-east-1:300000001502:billing-queue filterPolicy: status: - created filterPolicyScope: MessageAttributes rawMessageDelivery: false redrivePolicy: deadLetterTargetArn: arn:aws:sqs:us-east-1:300000001502:failed-ordersHow to build this setup yourself
topics-staging
awslocal sqs create-queue --queue-name billing-queueawslocal sqs create-queue --queue-name orders-dlqawslocal sqs create-queue --queue-name failed-ordersawslocal sns create-topic --name ordersawslocal sns subscribe --topic-arn arn:aws:sns:us-east-1:300000001501:orders --protocol sqs --notification-endpoint arn:aws:sqs:us-east-1:300000001501:billing-queue --return-subscription-arnawslocal sns set-subscription-attributes --subscription-arn arn:aws:sns:us-east-1:300000001501:orders:ad3c859e-d899-402e-949d-29261358e197 --attribute-name RawMessageDelivery --attribute-value trueawslocal sns set-subscription-attributes --subscription-arn arn:aws:sns:us-east-1:300000001501:orders:ad3c859e-d899-402e-949d-29261358e197 --attribute-name FilterPolicy --attribute-value '{"status": ["paid"]}'awslocal sns set-subscription-attributes --subscription-arn arn:aws:sns:us-east-1:300000001501:orders:ad3c859e-d899-402e-949d-29261358e197 --attribute-name RedrivePolicy --attribute-value '{"deadLetterTargetArn": "arn:aws:sqs:us-east-1:300000001501:orders-dlq"}'topics-prod
awslocal sqs create-queue --queue-name billing-queueawslocal sqs create-queue --queue-name orders-dlqawslocal sqs create-queue --queue-name failed-ordersawslocal sns create-topic --name ordersawslocal sns subscribe --topic-arn arn:aws:sns:us-east-1:300000001502:orders --protocol sqs --notification-endpoint arn:aws:sqs:us-east-1:300000001502:billing-queue --return-subscription-arnawslocal sns set-subscription-attributes --subscription-arn arn:aws:sns:us-east-1:300000001502:orders:42a00658-fa3a-414d-8276-42c8aef4ab9a --attribute-name RawMessageDelivery --attribute-value falseawslocal sns set-subscription-attributes --subscription-arn arn:aws:sns:us-east-1:300000001502:orders:42a00658-fa3a-414d-8276-42c8aef4ab9a --attribute-name FilterPolicy --attribute-value '{"status": ["created"]}'awslocal sns set-subscription-attributes --subscription-arn arn:aws:sns:us-east-1:300000001502:orders:42a00658-fa3a-414d-8276-42c8aef4ab9a --attribute-name RedrivePolicy --attribute-value '{"deadLetterTargetArn": "arn:aws:sqs:us-east-1:300000001502:failed-orders"}'All flags: kurkik sns diff · more Amazon SNS diff examples
Copyright © 2026 Pavel Bodiachevskii