Your current situation is:
- Amazon SQS queue (
Queue-A) in Account-A owned by you
- Amazon SNS topic (
Topic-B) in Account-B owned by somebody else
- Permissions have been added to
Topic-B that allows Account-A to subscribe to the topic
The above has worked well.
New requirements:
- Allow
Account-C and Account-D to subscribe to Topic-B
- The owner of
Account-B does not wish to modify the permissions on Topic-B to allow these subscription requests
Solution
Instead of Account-C and Account-D sending a Subscribe() request, ask the owner of Topic-B to directly subscribe the new queues.
You say that "the team that owns account B does not have the capacity to manually whitelist the many accounts we will be creating."
This is based on the idea that Account-C and Account-D should, themselves, send the Subscribe request to Topic-B. Instead, I am recommending that you provide the ARNs of Queue-C and Queue-D to the team that owns Topic-B and ask them to add these queues as subscribers. This does not require any change to the permission policy on Topic-B.
However, a couple of things to note:
Queue-C and Queue-D will need to confirm the subscription. The easiest way to do this is to view the initial message sent to the queue after being subscribed to the topic, copy the subscription URL shown in the message and then paste it into a web browser. This is a one-off process.
Queue-C and Queue-D will need to add permission to allow Topic-B to send a message to their queue. You probably have this in place already for Queue-A. The policy would look like:
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:ap-southeast-2:ccc:my-queue/SQSDefaultPolicy",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:ap-southeast-2:ccc:my-queue",
"Condition": {
"ArnEquals": {
"aws:SourceArn": "arn:aws:sns:ap-southeast-2:bbb:their-topic"
}
}
}
]
}
See also: