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: 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