What Is AWS SNS? A Hands-On Guide to Amazon Simple Notification Service

What is AWS SNS? It’s Amazon’s managed pub/sub service. Your app publishes a message to a topic once, and SNS pushes a copy to every subscriber: an SQS queue, a Lambda function, an email address or a phone.

Here’s the scenario it solves. An order ships, and four systems need to know: billing, the warehouse, analytics and the customer. Without SNS, your code calls all four. With SNS, it calls one topic and moves on.

Last checked against the AWS docs and pricing pages on November 21, 2026.

Before you start this lab:

  • AWS CLI v2 installed and a profile that isn’t your root user
  • An email inbox you can open, to confirm a subscription
  • About 15 minutes; everything here fits inside the SNS free usage

This post contains affiliate links. As an Amazon Associate, Stepstocloud.com earns from qualifying purchases.

SNS vs SQS is one of the most common Solutions Architect exam traps. If you’re preparing, the Sybex AWS Solutions Architect Study Guide drills it with practice questions.

What is AWS SNS: one app publishes a message to a topic that fans it out to a queue, a function, an email inbox and a phone
The publisher talks to one topic; SNS delivers a separate copy to each subscriber, so adding a fifth system never touches the publisher’s code.

How SNS works in three parts

Every SNS setup has the same three pieces:

  • Publisher: anything that sends a message. Your code, or an AWS service such as CloudWatch alarms, S3 event notifications or AWS Budgets.
  • Topic: a named channel with an ARN, like arn:aws:sns:us-east-1:123456789012:order-events.
  • Subscribers: endpoints that receive every message, unless a filter says otherwise. SQS, Lambda, HTTPS, email, SMS, mobile push and Amazon Data Firehose are all supported.

SNS pushes. Subscribers don’t poll. That’s the main difference from SQS, where consumers pull messages off a queue when they’re ready.

There are two topic types. Standard topics give the highest throughput with best-effort ordering and at-least-once delivery. FIFO topics keep strict order and remove duplicates, but they only deliver to SQS queues and cap at 100 subscriptions per topic.

Create a topic

If the CLI isn’t set up yet, follow our guide to installing the AWS CLI on Mac and Windows first. Then create a standard topic in us-east-1:

aws sns create-topic --name order-events --region us-east-1

You’ll get back a TopicArn. Copy it; every later command needs it. In the console the same step is Simple Notification Service > Topics > Create topic, then choose Standard and give it a name.

See also  AWS Guardrails: Benefits, AWS Control Tower Use Cases, Brand

Subscribe an email address

aws sns subscribe \
  --topic-arn arn:aws:sns:us-east-1:123456789012:order-events \
  --protocol email \
  --notification-endpoint you@example.com

Check your inbox for “AWS Notification – Subscription Confirmation” and click the link. Until you do, the subscription shows as PendingConfirmation and receives nothing.

Email is fine for alerts to a person. For anything an app sends to customers, use Amazon SES instead; SNS email has no templates and no custom sender.

Publish a test message

aws sns publish \
  --topic-arn arn:aws:sns:us-east-1:123456789012:order-events \
  --subject "Order 1001 shipped" \
  --message "Order 1001 left the warehouse at 10:42."

The command returns a MessageId within a second. The email usually lands a few seconds later. If it doesn’t, look in spam and confirm the subscription status reads Confirmed.

Fan out to SQS and Lambda

The real power of SNS is the fan-out pattern: one topic feeding several queues and functions, each doing its own job at its own pace.

SNS fan-out pattern: one topic sending copies of a message into three separate SQS queues, each read by its own worker
Putting an SQS queue behind each subscriber means a slow or offline consumer never loses messages; they wait in its queue.

Subscribing a queue is one command, but there’s a gotcha. The queue must allow SNS to write to it, or messages vanish silently. Add this to the queue’s access policy:

{
  "Effect": "Allow",
  "Principal": { "Service": "sns.amazonaws.com" },
  "Action": "sqs:SendMessage",
  "Resource": "arn:aws:sqs:us-east-1:123456789012:billing-queue",
  "Condition": {
    "ArnEquals": { "aws:SourceArn": "arn:aws:sns:us-east-1:123456789012:order-events" }
  }
}

The condition matters. Without it, any SNS topic in any account could write to your queue. Writing tight policies like this is covered in our introduction to AWS IAM.

aws sns subscribe \
  --topic-arn arn:aws:sns:us-east-1:123456789012:order-events \
  --protocol sqs \
  --notification-endpoint arn:aws:sqs:us-east-1:123456789012:billing-queue

Lambda works the same way with --protocol lambda. A common pairing: SNS triggers a Lambda function that writes each event into a DynamoDB table.

What if a subscriber is down? The SNS delivery retry policy keeps trying SQS and Lambda 100,015 times over 23 days.

HTTP, email and SMS endpoints get 50 attempts over about 6 hours, so attach a dead-letter queue to catch the rest.

Filter what each subscriber gets

By default every subscriber receives every message. The SNS message filtering guide explains how a filter policy on a subscription narrows that down by message attributes or by the JSON body.

SNS filter policy shown as a gate that only lets matching orange messages through to one subscriber
A filter policy sits on the subscription, not the topic, so each subscriber can pick a different slice of the same stream.

Say the warehouse queue only cares about shipped orders:

aws sns set-subscription-attributes \
  --subscription-arn <warehouse-subscription-arn> \
  --attribute-name FilterPolicy \
  --attribute-value '{"eventType":["order_shipped"]}'

Then publish with a matching attribute:

aws sns publish \
  --topic-arn arn:aws:sns:us-east-1:123456789012:order-events \
  --message '{"orderId":"1001"}' \
  --message-attributes '{"eventType":{"DataType":"String","StringValue":"order_shipped"}}'

Attribute-based filtering is free. Filtering on the message body is billed by the outbound payload it scans, so prefer attributes when you can. On Windows PowerShell, pass the JSON from a file with file:// to avoid quoting errors.

What is AWS SNS used for?

  • Fanning one event out to several microservices (orders, sign-ups, payments)
  • Ops alerts: CloudWatch alarms and AWS Budgets publish to a topic that emails or pages the on-call engineer; our AWS billing alert guide sets up the Budgets side step by step
  • Mobile push notifications through Apple and Google push services
  • Reacting to S3 uploads, for example resizing images in several sizes at once
  • SMS one-time codes and alerts (priced per country, with a default spend limit of $1.00 a month per account until you raise it)
See also  What Is AWS SQS? Amazon Simple Queue Service Explained With a Hands-On Lab

Check the limits before you build

The SNS endpoints and quotas page holds the numbers that shape a design. The big change many older tutorials miss: the default message size is still 256 KiB, but you can raise it to 1 MiB per topic.

LimitValue
Message size256 KiB default, up to 1 MiB via MaximumMessageSize
Bigger payloadsUp to 2 GB with the Extended Client Library (stored in S3)
Standard topics per account100,000
FIFO topics per account1,000
Subscriptions per standard topic12,500,000
Subscriptions per FIFO topic100
Filter policies200 per topic, 10,000 per account
Email delivery rate10 messages per second per subscription (hard limit)
Amazon SNS quotas page with the filter policy and message size limits highlighted
1: filter policy limits. 2: message size, 256 KiB by default and raisable to 1 MiB with the topic’s MaximumMessageSize attribute.

Check the bill: how much does Amazon SNS cost?

SNS charges for publishes and for deliveries, by endpoint type. The Amazon SNS pricing page lists these US East rates for standard topics:

ItemFree each monthPrice after that
Publishes (API requests)1 million$0.50 per million
Mobile push deliveries1 million$0.50 per million
HTTP/S deliveries100,000$0.60 per million
Email deliveries1,000$2.00 per 100,000
Deliveries to SQS and LambdaNo SNS delivery charge (data transfer and SQS/Lambda pricing apply)
Deliveries to Data FirehoseNone$0.19 per million
Amazon SNS notification delivery pricing table on the AWS pricing page with mobile push, email, HTTP and SQS rows highlighted
1: mobile push. 2: email, the priciest per message. 3: HTTP/S. 4: deliveries to SQS carry no SNS delivery charge.

One detail catches people: each 64 KB chunk counts as one request. A single 1 MiB publish is billed as 16 requests, and its deliveries are counted the same way.

A worked monthly example

Your order service publishes 3 million small messages a month. Two SQS queues subscribe, a webhook receives 500,000 of them over HTTPS, and 2,000 alerts go to an ops email list.

  • Publishes: 3M minus 1M free = 2M x $0.50 = $1.00
  • SQS deliveries: $0.00 from SNS (the queues bill their own requests)
  • HTTPS: 500K minus 100K free = 400K x $0.60 per million = $0.24
  • Email: 2,000 minus 1,000 free = 1,000 x $2.00 per 100K = $0.02

That’s about $1.26 a month in SNS charges, plus data transfer. SNS is rarely the expensive line on the bill; SMS and the downstream services are.

SNS vs SQS vs EventBridge

SNS vs SQS: a broadcast hub pushing copies to many receivers beside a single queue where one worker pulls messages
SNS pushes one message to many receivers; SQS holds messages until one consumer pulls and deletes each one.
SNSSQSEventBridge
ModelPub/sub, pushQueue, pullEvent bus with rules
Who gets a messageEvery subscriberOne consumerEvery matching rule target
Stores messagesNo (retries only)Yes, up to 14 daysOptional archive and replay
Best atHigh-volume fan-out, alerts, pushBuffering work, smoothing spikesRouting events from AWS and SaaS apps

Pick SNS for fast fan-out to many endpoints. Pick SQS when work must wait its turn. Pick Amazon EventBridge when you need content-based routing across many event sources. Plenty of designs use SNS and SQS together.

See also  What Is AWS high availability architecture + How To Achieve HA

Clean up

aws sns delete-topic --topic-arn arn:aws:sns:us-east-1:123456789012:order-events

Deleting the topic removes its subscriptions too. Delete any test SQS queues separately; an idle queue costs nothing, but tidy accounts are easier to audit.

Stack of AWS certification study guide books

AWS Solutions Architect study guide (Sybex)

Covers messaging (SNS, SQS, EventBridge) and decoupled designs, with practice tests. Check the exam code matches the current AWS exam.

Check price on Amazon

Frequently asked questions

What is the difference between Amazon SNS and SQS?

SNS is pub/sub: it pushes each message to every subscriber right away and doesn’t store it. SQS is a queue: it holds messages, up to 14 days, until one consumer pulls and deletes each one. Many systems use both, with SNS fanning a message out into several SQS queues.

Is AWS SNS free?

Partly. Each month the first 1 million publishes, 1 million mobile push deliveries, 100,000 HTTP/S deliveries and 1,000 email deliveries are free. After that, US East pricing starts at $0.50 per million publishes. Deliveries to SQS and Lambda carry no SNS delivery charge, though data transfer applies.

Is Amazon SNS like Kafka?

Only loosely. Both move messages between systems, but Kafka is a durable log that consumers can replay from any point. SNS pushes and forgets, apart from retries. If you need replay on AWS, look at Amazon Kinesis, Amazon MSK or EventBridge archives instead of SNS alone.

What is an SNS topic?

A topic is the named channel publishers send to and subscribers listen on. It has an ARN, an access policy and optional settings such as encryption, delivery retry policy and maximum message size. Standard topics favor throughput; FIFO topics keep strict order and remove duplicates.

What is the maximum message size in SNS?

The default is 256 KiB. You can raise it to 1 MiB per topic with the MaximumMessageSize attribute, and send payloads up to 2 GB with the SNS Extended Client Library, which stores the body in Amazon S3. Billing counts every 64 KB chunk as one request.

Can SNS send SMS text messages?

Yes. SNS can send SMS to phone numbers in many countries, priced per country. New accounts start with a $1.00 monthly SMS spend limit and in a sandbox, so you need to request a higher limit before sending to real customers.

Conclusion

SNS is the simplest way on AWS to say “this happened” once and let any number of systems react. You’ve now created a topic, subscribed to it, filtered it and priced it.

  • SNS pushes each message to every subscriber; SQS holds messages for one consumer to pull.
  • Put an SQS queue behind important subscribers, and give the queue an access policy with an aws:SourceArn condition.
  • Filter policies live on subscriptions; attribute filtering is free.
  • Messages default to 256 KiB and can go to 1 MiB; each 64 KB chunk is billed as one request.
  • The first million publishes each month are free, then $0.50 per million in US East.

Recommended reading

What is AWS SNS Pinterest pin: pub/sub messaging explained with a hands-on lab

Leave a Comment