AWS Simple Notification Service (SNS) CLI
AWS SNS is a messaging service that enables applications, end-users, and devices to send and receive notifications.
Accessing Amazon SNS in the AWS CLI.
One Way of accessing SNS messages via CLI
Create an SQS queue:
aws sqs create-queue --queue-name MySNSQueue
Subscribe the SQS queue to your SNS topic:
aws sns subscribe --topic-arn arn:aws:sns:us-west-2:123456789012:my-topic \
--protocol sqs \
--notification-endpoint arn:aws:sqs:us-west-2:123456789012:MySNSQueue
The above returns subscription arn you can use to unsubscribe:
aws sns unsubscribe --subscription-arn arn:aws:sns:us-west-2:123456789012:my-topic:1328f057-de93-4c15-512e-8bb22EXAMPLE
Receive messages from the SQS queue:
aws sqs receive-message --queue-url https://sqs.REGION.amazonaws.
Create/Delete a topic
aws sns create-topic --name my-topic
aws sns delete-topic --topic-arn arn:aws:sns:us-west-2:123456789012:my-topic
Publish to a topic
aws sns publish --topic-arn arn:aws:sns:us-west-2:123456789012:my-topic \
--message "Hello World!"
Listing topics and subscriptions
List topics:
aws sns list-topics
List subscriptions:
aws sns list-subscriptions