サービス · アプリケーション統合
Amazon Simple Notification Service (Amazon SNS)
Publish a message once, and SNS pushes it to every subscriber: queues, functions, apps, phones and email.
このレッスンはまだ翻訳されていないため、英語で表示しています。
- 1The order app publishes one message, “order placed”, to an SNS topic.
- 2SNS pushes a copy to every subscriber at the same time: a queue for the warehouse, a Lambda function that writes the invoice, and a text message to the customer.
流れ
- 1The order app publishes one message, “order placed”, to an SNS topic.
- 2SNS pushes a copy to every subscriber at the same time: a queue for the warehouse, a Lambda function that writes the invoice, and a text message to the customer.
- 1An EC2 instance sends its CPU use to Amazon CloudWatch.
- 2A CloudWatch alarm goes off when the CPU use stays too high, and publishes a message to an SNS topic.
- 3SNS sends an email and a text message to everyone who subscribed to the topic.
流れ
- 1An EC2 instance sends its CPU use to Amazon CloudWatch.
- 2A CloudWatch alarm goes off when the CPU use stays too high, and publishes a message to an SNS topic.
- 3SNS sends an email and a text message to everyone who subscribed to the topic.
An alert: a CloudWatch alarm uses SNS to reach the on-call team.
概要
Amazon Simple Notification Service (Amazon SNS) is a fully managed publish and subscribe (pub/sub) messaging service. A publisher sends a message to a topic. SNS then pushes a copy to every subscriber of that topic straight away. The publisher does not need to know who the subscribers are.
Subscribers can be applications or people. Applications receive messages through Amazon SQS queues, AWS Lambda functions or HTTPS endpoints. People receive them as text messages (SMS), mobile push notifications or email. Sending one message to several subscribers at once is called fan-out.
概要
SNS is the usual way to send alerts on AWS. For example, an Amazon CloudWatch alarm publishes to an SNS topic, and SNS emails and texts the people on call.
覚えること
- Push model: SNS delivers each message as soon as it is published.
- One message, many subscribers. This is called fan-out.
- Subscribers: SQS queues, Lambda functions, HTTPS endpoints, email, SMS and mobile push.
- Unlike a queue, SNS does not hold messages for subscribers to collect later. Subscribe an SQS queue when a system must not miss any.
覚えること
- Filter policies let each subscriber receive only the messages it needs.
- SNS email is plain text for alerts. For receipts and newsletters to customers, use Amazon SES.
試験では
- “Notify many subscribers when something happens” or “send an SMS or email alert” points to Amazon SNS.
- “Alert the operations team when CPU use is too high” points to an Amazon CloudWatch alarm that publishes to SNS.
- “Send each order to several queues, so different systems can process it” points to SNS fan-out to SQS.
混同しやすいもの
Amazon Simple Queue Service (Amazon SQS)A fully managed message queue, so the parts of an application can work at their own pace without losing messages.
Amazon Simple Email Service (Amazon SES)Sends and receives email at scale from your own domain: receipts, password resets, newsletters and marketing.
Amazon EventBridgeA serverless event bus that routes events from AWS services, your apps and SaaS apps to the targets that need them.