◄︎ Gregor's Portfolio Site
11 Jan 2020

Intro to amazon sns

Amazon Simple Notification Service (SNS) is a communication tool used to send alerts when specified events happen. It fills a small but important niche within the cloud application space, and that niche is event alerts.

SNS is geared towards internal notifications, rather than communication to end users. For end user communication, Amazon Pinpoint can be used, as it offers a similar but more expansive set of functionality with far more customer centric features, like customizable emails.

In general, AWS services are very modular, and no one service can work without relying on at least one other service. This is very true in the case of SNS, as it is a notification tool, but generally notifications are not created directly within it. Its job is simply to track lists of recipients, their chosen methods of communication and to deliver the messages.

A note on cost: SNS offers different pricing for each supported communication channel. As with most AWS services, there is a free tier. In this case the first 5,000 monthly target audience communications on each channel is free. SNS pricing model.

The essential concepts in SNS are Publishers, Topics and Subscribers.

  • Publishers are entities that send content (messages) into SNS. An alternative term for publishers are producers.

  • Topics are designated message groups, created by publishers. Each topic holds a list of potential recipients.

  • Subscribers are individual recipients who sign up and confirm their interest in one or more Topic. An alternative term for subscribers are consumers.

  • Publishers send messages to topics. When a message arrives in a topic, it is delivered to any registered subscriber. Many message formats are supported, and a subscriber chooses one of the following delivery formats when subscribing to a topic:

  • Text message (SMS)
  • Mobile push message (iOS, Android, Windows devices)
  • Email
  • HTTP/S web hooks
  • Lambda
  • SQS

  • The first three are standard messaging protocols. The last three are service endpoints. This allows for integration into other AWS services or elsewhere on the web.

    Examples of use cases for SNS include the following:

  • Sending text messages to admins when an EC2 server has a critical errors
  • Receive notifications for activity and events originating in other AWS accounts
  • Sending messages to an SQS queue to allow them to be consumed at a desired rate

  • SNS Walkthrough