Interview Prep/AWS/Route 53, CloudFront, API Gateway and Messaging

SNS in account A publishes successfully, but the SQS queue in account B never receives anything.

IntermediateTroubleshootingRoute 53, CloudFront, API Gateway and Messaging
Answer

Likely causes → The SQS queue policy does not allow sqs:SendMessage from sns.amazonaws.com with aws:SourceArn set to the topic. The queue uses SSE with the AWS managed key aws/sqs, which SNS cannot use. Or the cross-account subscription was never confirmed.

Diagnose →

aws sqs get-queue-attributes --queue-url <url> --attribute-names Policy KmsMasterKeyId
aws sns list-subscriptions-by-topic --topic-arn <topic-arn>
# SNS delivery status logging / NumberOfNotificationsFailed metric on the topic

Fix →

  1. Add a queue policy statement that allows sns.amazonaws.com with "ArnEquals":{"aws:SourceArn":"<topic-arn>"}
  2. Switch the queue to a CMK whose key policy allows sns.amazonaws.com to use kms:GenerateDataKey* and kms:Decrypt, or to SSE-SQS
  3. Confirm the subscription from account B

Prevent → Use a reusable cross-account fan-out module, and alarm on NumberOfNotificationsFailed.

aws All AWS questions Roadmap: AWS core services

More on Route 53, CloudFront, API Gateway and Messaging