简体   繁体   English

确定订阅SQS队列的SNS主题

[英]Determine which SNS topics a SQS queue is subscribed to

Is there a way to list all of the AWS SNS topics that a particular SQS queue is subscribed to, using the AWS CLI? 有没有办法使用AWS CLI列出特定SQS队列订阅的所有AWS SNS主题?

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. 我已经知道如何在SNS主题上查看订阅者列表,但这只有在我知道SNS主题的名称时才有效。 In this case, I only know the name of the SQS queue. 在这种情况下,我只知道SQS队列的名称。

I wasn't able to find anything by searching the interwebs . 通过搜索互联网我无法找到任何东西。

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). 没有这样的API用于此目的,因此解决方法可以使用SNS cli命令aws sns list-subscriptions并通过SQS arn过滤(可能使用grep命令)。 This approach may not be feasible depending on how many subscriptions exists on you account (results are paginated in a 100 items batch). 这种方法可能不可行,具体取决于您帐户中存在多少订阅(结果在100个项目批处理中分页)。 You can filter subcriptions by topic to reduce results by using list-subscriptions-by-topic . 您可以按主题过滤子目录,以通过逐个主题list-subscriptions-by-topic来减少结果。

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

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