SNS

Document | Workshop

Overview

  • fully managed topic-based pub/sub model.

  • Auto scale

  • Built-in encryption

  • Allowing asynchronous communication between apps.

Features

  • A2A messaging

  • Application-to-person notification (mobile phone, mobile app, email)

Filter policy

  • Is a JSON object containing properties that define which messages the subscriber receives.

  • To receive only a subset of the messages, a subscriber must assign a filter policy to the topic subscription. If a subscription doesn't have a filter policy, the subscriber receives every message published to its topic.

Message security

  • Encryption at rest (AWS KMS)

  • In-flight encryption by establishing a private connection between SNS & VPC.

  • Access control: IAM policies

  • SNS Access Policies (similar to S3 bucket policies)

Publish method

Topic publish

Direct publish

- create topic, subscription - Publish to the topic

- Create a platform app - Create a platform endpoint - Publish to that endpoint

Best practices

  • Use topics to organize messages.

  • Ensure that topic is NOT publicly accessible.

  • Use subscriptions to control message delivery

  • Using domain name instead of raw http endpoints.

FAQ

  • FIFO topic names must end with .fifo

  • Max 12.5 milions subscribers

  • Max 100,000 topics.

Last updated