☁︎SAA-C03

SNS

SNS — Concept

What it is

Amazon Simple Notification Service (SNS) = managed pub/sub messaging. Publishers push to a topic; SNS fans out to all subscriptions in parallel.

Why it exists

You want one event to reach many consumers (a queue, a Lambda, email, SMS, HTTPS endpoint) without each publisher knowing about each subscriber.

Subscriber types

  • SQS queues (most common; reliable fanout)
  • Lambda functions
  • HTTP / HTTPS endpoints
  • Email / Email-JSON
  • SMS (text messages)
  • Mobile push (APNS, FCM, ADM)
  • Kinesis Data Firehose (for analytics fanout)
  • EventBridge event bus (for cross-account routing)

Topic types

Standard topicFIFO topic
Orderbest-effortstrict per group
Deliveryat-least-onceexactly-once
Subscribersmany typesSQS FIFO only
Usebroad fanoutordered fanout

Filtering

  • Subscription filter policies (JSON) on message attributes — subscriber only gets messages matching the filter. Reduces app-side filtering and SQS message volume.

Delivery & retries

  • For HTTP/HTTPS: configurable retry policy.
  • For SQS / Lambda: handled by those services.
  • Failed deliveries can go to DLQ per subscription.

Security

  • Topic policy (resource-based) for cross-account access.
  • KMS encryption at rest.
  • VPC endpoint (Interface) for private access.

Common patterns

  • Fanout: SNS → multiple SQS queues (one per downstream service).
  • Workflow notification: alarm → SNS → Lambda + email + Slack via HTTPS.
  • CloudWatch Alarms publish to SNS topics for paging.
  • Mobile push notifications.

When to use vs alternatives

Use ...Instead of ...When ...
SNS → SQS fanoutDirect producer-to-manyFanout one event to many durable queues
EventBridgeSNSEvent router with rich filtering, archive, replay, cross-account
SQSSNSSingle consumer queue (decoupling)
KinesisSNSStreaming analytics with multiple long-lived consumers
Step FunctionsSNSOrchestrate multi-step workflows

Common exam scenarios

  1. "Send one event to email + Lambda + SQS reliably"SNS topic with 3 subscribers.
  2. "Fanout with filters to different queues" → SNS + subscription filter policies.
  3. "FIFO ordering across fanout"SNS FIFO topic + SQS FIFO subscribers.
  4. "Cross-account event routing with rich filtering, replay, archive"EventBridge, not SNS.
  5. "Publish mobile push to iOS + Android" → SNS with platform endpoints.

Exam tip

  • One-to-manySNS.
  • Many-to-oneSQS.
  • Cross-AWS-service routing & filtersEventBridge.

References