简体   繁体   中英

AWS SQS subscription to AWS SNS topic

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM