AWS Notes

Simple Notification Service (SNS)

Last updated
Reading time
2 min read

Overview

SNS is AWS's pub/sub service. Publishers publish to an SNS topic that can be subscribed to A2P (application to person) or A2A (application to application). A publisher can be a web or mobile application or a backend service. A subscriber could be another AWS service like a Lambda function, SQS, or Kinesis Data Firehose; or they could be a person where the message is sent to a user via text, email, or mobile push notification.

Examples

  1. (A2P) When publishing a new article, subscribers in an email list can receive notifications.

  2. (A2A) An S3 bucket can publish an event that an image has been uploaded. Using a Fanout pattern, the subscribers to that SNS topic can be other AWS services that perform actions in parallel on the image such as archiving with Glacier, resizing with a Lambda function to generate a thumbnail, and storing the metadata in a database like DynamoDB.

Considerations

  1. Permissions should be tightly configured around who can publish or subscribe to a topic

  2. Consider adding tracking about subscriptions and delivery metrics to ensure reliability and that everything is working properly

  3. If data being published is sensitive, it should be encrypted using KMS or sent privately with PrivateLink for greater security