Linux command
aws-sns 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create a new SNS topic
aws sns create-topic --name [topic-name]
List all topics
aws sns list-topics
Publish a message
aws sns publish --topic-arn [arn:aws:sns:region:account:topic-name] --message "[Hello World]"
Subscribe an email endpoint
aws sns subscribe --topic-arn [arn:aws:sns:region:account:topic-name] --protocol email --notification-endpoint [user@example.com]
Subscribe a Lambda function
aws sns subscribe --topic-arn [arn:aws:sns:region:account:topic-name] --protocol lambda --notification-endpoint [arn:aws:lambda:region:account:function:name]
Unsubscribe from a topic
aws sns unsubscribe --subscription-arn [arn:aws:sns:region:account:topic-name:subscription-id]
List subscriptions
aws sns list-subscriptions-by-topic --topic-arn [arn:aws:sns:region:account:topic-name]
Delete a topic
aws sns delete-topic --topic-arn [arn:aws:sns:region:account:topic-name]
说明
aws sns is the AWS CLI interface for Amazon Simple Notification Service (SNS), a fully managed messaging service for application-to-application (A2A) and application-to-person (A2P) communication. SNS enables pub/sub messaging where publishers send messages to topics, and subscribers receive notifications via protocols including HTTP/HTTPS, email, SMS, SQS, Lambda, and mobile push notifications.
FAQ
What is the aws-sns command used for?
aws sns is the AWS CLI interface for Amazon Simple Notification Service (SNS), a fully managed messaging service for application-to-application (A2A) and application-to-person (A2P) communication. SNS enables pub/sub messaging where publishers send messages to topics, and subscribers receive notifications via protocols including HTTP/HTTPS, email, SMS, SQS, Lambda, and mobile push notifications.
How do I run a basic aws-sns example?
Run `aws sns create-topic --name [topic-name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more aws-sns examples?
This page includes 8 examples for aws-sns, plus related commands for nearby Linux tasks.