How to Send or Publish SNS Message using AWS CLI



We can make use of the aws sns publish command on the AWS CLI to send a message to an AWS SNS topic.

Example:

% aws sns publish 
 --topic-arn arn:aws:sns:us-east-1:107xx89xx9xx:smsTopic 
 --message "Learning AWS SNS"

-------------------------------------------------------
|                       Publish                       |
+-----------+-----------------------------------------+
|  MessageId|  141997xx-8c80-5bxx-8ff3-cacxx6xx7508   |
+-----------+-----------------------------------------+
Publishing to AWS SNS Topic Example
-

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