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 Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to AWS,
- Get the total size and number of objects of a AWS S3 bucket and folders
- How to Create AWS SNS Topic using AWS CLI
- Fix: Amazon Linux bash: sudo: command not found
- [Solution] AWS Java SDK S3 AmazonS3Exception InvalidAccessKeyId
- Create an AWS User using CLI2 Command at a specific Path
- Fix: Missing the following required SSO configuration values: sso_start_url, sso_region
- Fix: zsh: command not found: aws (Mac/macOS)
- Configure AWS Access ID and Secret Keys using CLI on Mac
- Quick way to setup AWS DynamoDB locally on macOS
- Most Essencial AWS CLI 2 S3 ls Command Options
- How to Check AWS SNS Permissions using CLI
- AWS CLI Change Default Output Format
- How to install AWS CLI on Ubuntu
- Quick way to install AWS CLI for macOS Terminal
- Install AWS CLI using Brew Command
- AWS CLI Command to Get a List of SNS Topics
- Get List of AWS SNS Topic Subscriptions using CLI
- How to Setup AWS Credentials using Visual Studio Code
- Installing AWS CLI Version 2 on macOS Sonoma using Terminal
- AW3 CLI command to get list of all region names
- AWS SNS CLI Command Publish Message Attributes
- Create an S3 bucket in a specific AWS region using CLI Command
- [Fix] zsh: command not found: awscli [Mac Terminal]
- Understanding AWS Calculator: DynamoDB on-demand capacity
- [Solution] com.amazonaws.dynamodb.v20120810 MissingAuthenticationToken Key Id or X.509 certificate
More Posts:
- How to remove/delete a directory in Linux/macOs - Linux
- Java -Day of the week using Java 8 DayOfWeek Enum - Java
- Android : Connection with adb was interrupted 0 attempts have been made to reconnect - Android
- How to send WhatsApp message from your Android App using Intent - WhatsApp
- How to Pretty Print cURL JSON Output in Terminal - cURL
- Where are screenshots saved on Windows 11 using Snipping Tool? - Windows-11
- Which Python version is bundled with macOS Sonoma 14 by default - MacOS
- [Fix] Instant java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Years - Java