Get List of AWS SNS Topic Subscriptions using CLI


In order to retrieve the list of all the subscriptions for an AWS SNS Topic via CLI you can make use of the aws sns list-subscriptions-by-topic command.


Syntax:

aws sns list-subscriptions-by-topic --topic-arn <topic-arn>

Example:

aws sns list-subscriptions-by-topic --topic-arn arn:aws:sns:us-east-1:5762xx665xx1:smslTopic

-------------------------------------------------------------------------------------------------------------
|                                         ListSubscriptionsByTopic                                          |
+-----------------------------------------------------------------------------------------------------------+
||                                              Subscriptions                                              ||
|+-----------------+---------------------------------------------------------------------------------------+|
||  Endpoint       |  +1xx-xx-xx-xx                                                                        ||
||  Owner          |  5762xx665xx1                                                                         ||
||  Protocol       |  sms                                                                                  ||
||  SubscriptionArn|  arn:aws:sns:us-east-1:5762xx665xx1:emailTopic:eeb4f499-exx2-xxba-aexx-3915c1134254   ||
||  TopicArn       |  arn:aws:sns:us-east-1:5762xx665xx1:emailTopic                                        ||
|+-----------------+---------------------------------------------------------------------------------------+|
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap