If you want to send a message attributes using AWS SNS using CLI you can make use of the aws sns publish command and --message-attributes option.
Syntax:aws sns publish --topic-arn arn
--message "Testing AWS SNS with message attributes"
--message-attributes attribute_name={DataType=String,StringValue=value}
attribute_name={DataType=Number,StringValue=value}
Example:
aws sns publish
--topic-arn arn:aws:sns:us-east-1:13xx6xx9xx:smsTopic
--message "Important notification"
--message-attributes
Name={DataType=String,StringValue=Sam} Age={DataType=Number,StringValue=22}

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!