Fan out SNS messages to multiple SQS queues with subscription filter policies

domain: aws-sns · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create an SNS topic (Standard for fan-out, FIFO only if strict ordering is required across all subscribers); create one SQS queue per downstream consumer
  2. Subscribe each SQS queue to the SNS topic; grant SNS permission to send to each SQS queue by attaching a queue policy that allows sns:SendMessage from the topic ARN
  3. Set a subscription filter policy (JSON object matching message attributes) on each subscription so each queue only receives relevant message subsets — this reduces processing cost and simplifies consumer logic
  4. When publishing, include MessageAttributes that match your filter policy keys and values; messages without the required attributes are filtered out at the SNS level (not delivered to that subscription)
  5. Enable raw message delivery on the SQS subscription if you want SQS consumers to receive the original message body without the SNS JSON envelope; leave it disabled if consumers need SNS metadata like TopicArn or MessageId
  6. For cross-account fan-out, add the receiving account's SQS queue ARN to the subscription and ensure both the queue policy and the SNS topic policy allow the cross-account action

Known gotchas

Related routes

Set up SNS fanout to multiple SQS queues with subscription filter policies
docs.aws.amazon.com · 5 steps · unrated
Fan out an SNS FIFO topic to subscribed SQS FIFO queues and understand what message-group and dedup metadata propagates automatically
aws-sns · 6 steps · unrated
Fan out messages from an SNS FIFO topic to a Lambda function
docs.aws.amazon.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans