简体   繁体   English

AWS SQS订阅AWS SNS主题

[英]AWS SQS subscription to AWS SNS topic

I have use case in that I want to subscribe single SQS to two SNS topic. 我有一个用例,我想将单个SQS订阅两个SNS主题。 So that whatever message publish to any SNS should be available in SQS. 这样,发布到任何SNS的任何消息都应该在SQS中可用。 So my question is Can we subscribe one sqs to two SNS topic? 所以我的问题是我们可以为两个SNS主题订阅一平方吗?

Any help here will be appreciated. 在这里的任何帮助将不胜感激。

Yes, that is possible. 是的,那是可能的。

A single SQS can subscribe to multiple SNS Topics 一个SQS可以订阅多个SNS主题

{
"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. 它允许其他sns写入同一队列。

I have answered the same here SNS multiple subscribers 我在这里回答了同样的问题SNS多个订阅者

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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