5
votes

Is there a way to list all of the AWS SNS topics that a particular SQS queue is subscribed to, using the AWS CLI?

I already know how to see the list of subscribers on an SNS topic, but that only works if I know the name of the SNS topic. In this case, I only know the name of the SQS queue.

I wasn't able to find anything by searching the interwebs.

1

1 Answers

8
votes

There is no such API for this purpose, so as a work around you can use SNS cli command aws sns list-subscriptions and filter by your SQS arn (using a grep command maybe). This approach may not be feasible depending on how many subscriptions exists on you account (results are paginated in a 100 items batch). You can filter subcriptions by topic to reduce results by using list-subscriptions-by-topic.