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.
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.
Yes, that is possible.
A single SQS can subscribe to multiple SNS Topics
{
"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