2

I have use case in that I want to subscribe single SQS to two SNS topic. So that whatever message publish to any SNS should be available in SQS. So my question is Can we subscribe one sqs to two SNS topic?

Any help here will be appreciated.

suraj chopade
  • 2,833
  • 3
  • 13
  • 15

2 Answers2

5

Yes, that is possible.

A single SQS can subscribe to multiple SNS Topics

Arafat Nalkhande
  • 11,078
  • 9
  • 39
  • 63
1
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:us-east-1:<account-number>:<sqs-name>/SQSDefaultPolicy",
"Statement": [
     {
    "Sid": "<sid>",
    "Effect": "Allow",
    "Principal": "*",
    "Action": "SQS:SendMessage",
    "Resource": "arn:aws:sqs:us-east-1:<account-number>:<name>",
    "Condition": {
            "ArnEquals": {
                  "aws:SourceArn": "arn:aws:sns:us-west-2:<account-number>:*"
                 }
            }
  }
 ]
}

Here * is the key. It allows other sns to write to the same queue.

I have answered the same here SNS multiple subscribers

Raccoon
  • 400
  • 4
  • 13