问题
We have an SNS queue with multiple subscribers (2 * SQS, 1 * email, etc.). However, we only get the notification for the last subscriber. I.e. when each of them is registered alone we get to notification. So as far as I understand each of them alone is configured all right.
I didn't find any relevant AWS documentation about it (limit of subscribers, policies, etc.)
Would love to hear any hint about it. Thanks in advance.
Solution: the issue was the order in which the SQS permission-subscription was created in. The correct order is detailed here. If you do step 3 before 2 it won't work.
回答1:
The issue was the order in which the SQS permission-subscription was created in. The correct order is detailed here. If you do step 3 before 2 it won't work.
回答2:
{
"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.
来源:https://stackoverflow.com/questions/39244881/sns-multiple-subscribers