Reputation: 3323
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.
Upvotes: 2
Views: 4057
Reputation: 630
{
"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
Upvotes: 1
Reputation: 11708
Yes, that is possible.
A single SQS can subscribe to multiple SNS Topics
Upvotes: 5