How to delete AWS SNS Subscription using CLI


If you want to delete an AWS SNS Topic using the AWS CLI you can make use of the aws sns unsubscribe command.

Let's take a look at an example.


Syntax:

aws sns unsubscribe --subscription-arn <subscription-arn> 

Example:

% aws sns unsubscribe --subscription-arn 
      arn:aws:sns:us-east-1:5xx211xx5xx1:smsTopic:e25591a4-a7xx-45xx-acxx-7b1xx37bcxx8
Example - Delete AWS SNS Subscription using CLI

If you want to get a list of all the subscriptions for a given SNS topic, you can make use of the below command.

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

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

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