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

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!