Messaging & events on AWS โ an interactive field guide
Learn how Amazon SQS, Amazon SNS and Amazon EventBridge (plus Kinesis, MQ, Step Functions and friends) let systems talk without depending on each other. Watch every step, replay it, then test yourself.
Facts checked against AWS documentation as of November 1, 2026, including the 2025โ2026 changes: 1 MiB payloads, SQS fair queues, SNS 1 MiB topics, and the relaunched EventBridge Custom Event Bus.
Step through simulations
Every module has a live diagram. Press Next (or โ) to move a message one step, Back (โ) to rewind, or click any step to jump there.Pick your depth
Use the switch at the top right. Plain English keeps things simple; Technical expands API calls, limits, payloads and edge cases everywhere.Practise
Each module ends with flashcards and a quiz with explanations. The final exam pulls random questions from every module.Why decouple at all?
Imagine phoning a shop to order something: if nobody answers, you can't order. Now imagine leaving a note in their mailbox instead: they'll read it when they can, and you can get on with your day. Decoupling means building software the mailbox way. Hit Play to see the difference.
The three core services, in one picture each
Amazon SQS โ the to-do rail
Queue. Work tickets wait on a rail until a worker is free to take one. Each ticket is handled by one worker, then thrown away.
Pull-based ยท stores messages up to 14 days ยท one consumer per message
Amazon SNS โ the loudspeaker
Topic. Make one announcement; everyone who signed up hears it instantly โ apps, queues, email, text messages.
Push-based ยท no storage ยท one message โ many receivers
Amazon EventBridge โ the sorting office
Event bus. Anyone drops "this happened" notes on the bus; sorting rules read each note and send copies only to whoever asked for that kind.
Content-based routing ยท AWS & SaaS sources ยท (new) retention & ordering
Key vocabulary
- Producer / publisher
- The system that sends a message or event.
- Consumer / subscriber / target
- The system that receives it and does something.
- Message
- A packet of data, often a request for work: "ship order 42".
- Event
- A record of a fact: "order 42 was placed". Senders don't know who listens.
- Queue ยท Topic ยท Bus ยท Stream
- Holding line for work ยท broadcaster ยท router ยท recorded log.
- Asynchronous
- Hand off and move on, instead of waiting for an answer.
- At-least-once delivery
- Never lost, but occasionally delivered twice.
- Idempotent
- Doing it twice has the same result as doing it once โ the cure for duplicates.
- Dead-letter queue (DLQ)
- Where repeatedly failing messages are parked for inspection.
- Fan-out
- One message delivered to many receivers.
Warm-up flashcards
Warm-up quiz
๐ฌ Amazon SQS Simple Queue Service
A fully managed message queue. Producers drop messages in; consumers pull them out when ready. Nothing is lost if a consumer is busy, slow, or down.
๐ณ The analogy
The ticket rail in a restaurant kitchen. Waiters clip tickets on; any free cook takes the next one, flips it face-down while cooking, and bins it when the dish is served. If a cook walks off mid-dish, the ticket flips back up for someone else.โ Use it whenโฆ
- Work should happen in the background (emails, image processing, orders)
- Traffic is spiky and you need a buffer
- One worker should handle each item
- You need ordering per key (FIFO)
โ ๏ธ Not ideal whenโฆ
- Many different systems need the same message (use SNS/EventBridge in front)
- Multiple apps must replay history (use a stream)
- You need a reply right now (use a synchronous API)
Interactive simulator
Deep dive
| Key numbers (current defaults & limits) | |
|---|---|
| Max message size | 1 MiB (raised from 256 KiB, Aug 2025) ยท up to 10 message attributes |
| Retention | Default 4 days ยท 60 s to 14 days |
| Visibility timeout | Default 30 s ยท 0 s to 12 h |
| Long polling | WaitTimeSeconds up to 20 s |
| Delay queue / message timer | 0 to 15 minutes (no per-message timers on FIFO) |
| Batch size | Up to 10 messages per Send/Receive/Delete batch |
| In-flight messages | ~120,000 (Standard) ยท 120,000 (FIFO) |
| FIFO throughput | 300 TPS per API action; up to 3,000 msg/s with batching; much higher in high-throughput mode |
| FIFO de-duplication interval | 5 minutes |
Message life-cycle: stored โ in flight โ deleted
A message is stored after SendMessage (no limit on stored messages). After ReceiveMessage it is in flight: invisible to other consumers for the visibility timeout. The consumer must call DeleteMessage with the receipt handle; otherwise the message becomes visible again and its ApproximateReceiveCount increments on the next receive. Extend a long job with ChangeMessageVisibility.
When ApproximateReceiveCount exceeds the redrive policy's maxReceiveCount, SQS moves the message to the dead-letter queue. Redrive it back with StartMessageMoveTask.
Standard vs. FIFO vs. fair queues
| Standard | FIFO | Standard + fair queues | |
|---|---|---|---|
| Ordering | Best effort | Strict within MessageGroupId | Best effort; fair across groups |
| Delivery | At least once | Exactly-once processing (5-min dedup) | At least once |
| Throughput | Nearly unlimited | 300 TPS/action (3,000 msg/s batched); higher with HT mode | Nearly unlimited |
| Use for | Most background work | Payments, inventory, state changes per entity | Multi-tenant SaaS: stops one tenant from delaying others |
Consuming with AWS Lambda
- The Lambda event source mapping polls the queue, invokes your function with a batch, and deletes messages on success.
- Return
batchItemFailures(enableReportBatchItemFailures) so only failed messages are retried. - Set the queue's visibility timeout to at least 6ร the function timeout.
- The event source mapping supports 1 MiB payloads. Provisioned mode supports up to 10,000 event pollers per mapping (Aug 2026).
Design tips & pitfalls
- Idempotency: standard queues can deliver duplicates โ use a dedup key (order ID) with a conditional write.
- Poison messages: always configure a DLQ and alarm on it. Make DLQ retention longer than the source queue's.
- Large payloads: above 1 MiB, store in S3 and send the pointer (claim-check).
- Scaling consumers: autoscale on
ApproximateNumberOfMessagesVisibleandApproximateAgeOfOldestMessage. - Cost: batch requests and use long polling; each 64 KB chunk of a request is billed as one request.
Real-world examples
๐ผ๏ธ Photo-upload thumbnails
A user uploads a photo. The app replies "Uploaded!" right away and puts a "make thumbnails" message in a queue. A fleet of workers grows on busy evenings and shrinks overnight.
Code (Python consumer)
import boto3, json
sqs = boto3.client("sqs")
URL = "https://sqs.us-east-1.amazonaws.com/111122223333/thumbs"
while True:
resp = sqs.receive_message(QueueUrl=URL, MaxNumberOfMessages=10,
WaitTimeSeconds=20) # long polling
for m in resp.get("Messages", []):
job = json.loads(m["Body"])
make_thumbnails(job["bucket"], job["key"]) # idempotent
sqs.delete_message(QueueUrl=URL,
ReceiptHandle=m["ReceiptHandle"])๐ฆ Ordered account ledger
Deposits and withdrawals for each account must apply in order and exactly once. A FIFO queue uses the account number as the MessageGroupId, so thousands of accounts process in parallel while each stays in sequence.
Code (send to FIFO)
sqs.send_message(
QueueUrl=FIFO_URL,
MessageBody=json.dumps({"acct": "A-42", "op": "withdraw", "amt": 50}),
MessageGroupId="A-42", # order per account
MessageDeduplicationId="txn-9f1c") # safe to retry๐๏ธ Flash-sale buffer
A sale drives 50ร normal traffic. Orders go into a queue so the inventory database is written at a safe, steady rate. Customers see "Order received" instantly.
๐ข Multi-tenant SaaS jobs
One big customer submits 1 million report jobs. With fair queues (tenant ID as MessageGroupId on a Standard queue), small customers' jobs keep flowing instead of waiting behind the giant batch.
Security
Checklist
- ๐ Least privilege: producers get only
sqs:SendMessage; consumers get Receive/Delete/ChangeMessageVisibility. - ๐ Queue policy: never allow
"Principal":"*"without tight conditions; useaws:PrincipalOrgIDfor cross-account. - ๐ Encryption at rest: SSE-SQS is on by default for new queues; choose SSE-KMS for your own key, rotation control and CloudTrail visibility of key use.
- ๐ท๏ธ SSE encrypts the body only โ don't put sensitive data in message attributes.
- ๐ In transit: deny non-TLS requests (
aws:SecureTransport). Requests to SSE queues must use HTTPS and SigV4. - ๐ Private network: VPC interface endpoints +
aws:SourceVpceconditions. - ๐ต๏ธ Confused deputy: when allowing SNS/EventBridge/S3 to send, add
aws:SourceArn. - ๐ Audit with CloudTrail; alarm on DLQ depth and unusual age of oldest message.
Example queue policy
Lets only one SNS topic deliver, and refuses any non-TLS call.
{
"Version": "2012-10-17",
"Statement": [
{ "Sid": "AllowOrderTopicOnly",
"Effect": "Allow",
"Principal": { "Service": "sns.amazonaws.com" },
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:us-east-1:111122223333:inventory-queue",
"Condition": { "ArnEquals": {
"aws:SourceArn": "arn:aws:sns:us-east-1:111122223333:order-events" } } },
{ "Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "sqs:*",
"Resource": "arn:aws:sqs:us-east-1:111122223333:inventory-queue",
"Condition": { "Bool": { "aws:SecureTransport": "false" } } }
]
}Flashcards
Quiz
๐ข Amazon SNS Simple Notification Service
Fully managed publish/subscribe. Publish a message once to a topic, and SNS pushes a copy to every subscriber โ services, queues, functions, web hooks, email, SMS and phones.
๐ป The analogy
A group text or a PA system. You say it once; everyone who joined the group hears it at the same moment. If someone's phone is off, SNS keeps trying for a while โ but it doesn't keep a voicemail box. That's what SQS is for.โ Use it whenโฆ
- One event must reach many systems at once
- You need to notify people (email, SMS, mobile push)
- You want very low-latency push delivery
- Building SNS โ SQS fan-out
โ ๏ธ Not ideal whenโฆ
- Consumers need to read later at their own pace (add SQS)
- You need complex routing on many sources or SaaS events (EventBridge)
- You need replay of history (stream or new EventBridge bus)
Interactive simulator
Deep dive
| Key numbers | |
|---|---|
| Subscriptions per topic | 10 million (default, adjustable) |
| Topics per account | 100,000 (default, adjustable) |
| Message size | 256 KiB default ยท up to 1 MiB with MaximumMessageSize (Sept 2026; then โค100 subscriptions; SQS/Lambda/Firehose only) ยท billed per 64 KB chunk |
| Filter policies | 200 per topic (default) ยท 5 keys per policy ยท 150 value combinations |
| Retries โ SQS, Lambda | 100,015 attempts over 23 days |
| Retries โ email, SMS, mobile push | 50 attempts over 6 hours |
| Retries โ HTTP/S | Custom delivery policy; total โค 3,600 s |
Standard vs. FIFO topics
Standard topics: best-effort ordering, at-least-once delivery, all protocols, very high throughput.
FIFO topics (.fifo): strict ordering per MessageGroupId, de-duplication, delivered to SQS queues; support message filtering including on the message body. Pair an SNS FIFO topic with SQS FIFO queues for ordered, exactly-once fan-out.
Filter policies in practice
{
"eventType": ["order_placed", "order_updated"],
"amount": [{ "numeric": [">=", 100, "<", 5000] }],
"region": [{ "anything-but": ["test"] }],
"sku": [{ "prefix": "BOOK-" }]
}
Keys are ANDed; values within a key are ORed. Set FilterPolicyScope to MessageBody to filter on the JSON payload. Filter policy additions and changes can take several minutes to fully take effect, so test before relying on them.
Delivery, retries and DLQs
Delivery policies have four phases: immediate retries โ pre-back-off โ back-off (arithmetic, exponential, geometric or linear) โ post-back-off. Only HTTP/S policies are customizable. Server-side errors are retried; client-side errors (deleted endpoint, permission problems) go straight to the DLQ if one is attached. The DLQ is an SQS queue on the subscription, same account and Region.
Enable delivery status logging to CloudWatch Logs for visibility into successes and failures per protocol.
Real-world examples
๐งพ Order placed โ everyone knows
One "order placed" message fans out to queues for billing, shipping and analytics. Adding a loyalty-points service later is just one new subscription โ no change to the order service.
๐จ Operations alerts
CloudWatch alarms publish to an SNS topic that emails the on-call team, sends an SMS, and invokes a Lambda function to open a ticket automatically.
๐ฑ Mobile push
A delivery app notifies millions of phones "Your order is out for delivery" using SNS mobile push to APNs and FCM.
๐ฐ Price updates in order
An SNS FIFO topic sends price changes for each product (group = SKU) to wholesale and retail SQS FIFO queues, filtered by business line, so no store ever applies an older price after a newer one.
Code (Python publish)
sns.publish(
TopicArn="arn:aws:sns:us-east-1:111122223333:prices.fifo",
Message=json.dumps({"sku": "PART-88", "price": 41.90, "business": "retail"}),
MessageGroupId="PART-88",
MessageDeduplicationId="PART-88-v1734")Security
Checklist
- ๐ Topic access policy: restrict
sns:Publishandsns:Subscribe; useaws:SourceArn/aws:SourceAccountwhen AWS services publish. - ๐งท Limit who can subscribe what: conditions like
sns:Protocolandsns:Endpointstop someone adding an outside email or URL. - ๐ SSE with KMS: when AWS services (CloudWatch, S3, EventBridge) publish to an encrypted topic, use a customer managed key that allows that service principal.
- ๐ Use HTTPS endpoints, deny non-TLS publishing (
aws:SecureTransport), and use VPC interface endpoints for private publishing. - โ๏ธ HTTP subscribers must verify signatures (SignatureVersion 2 = SHA256) and check
SigningCertURLandTopicArn. - ๐ช Set
AuthenticateOnUnsubscribewhen confirming, so strangers can't unsubscribe you. - ๐งฝ Message data protection policies can audit, mask or block sensitive data (e.g., PII) flowing through a topic.
Example topic policy
Only CloudWatch alarms from this account may publish; only SQS/Lambda subscriptions within the organization.
{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow",
"Principal": { "Service": "cloudwatch.amazonaws.com" },
"Action": "sns:Publish",
"Resource": "arn:aws:sns:us-east-1:111122223333:ops-alerts",
"Condition": { "StringEquals": { "aws:SourceAccount": "111122223333" } } },
{ "Effect": "Allow",
"Principal": { "AWS": "*" },
"Action": "sns:Subscribe",
"Resource": "arn:aws:sns:us-east-1:111122223333:ops-alerts",
"Condition": {
"StringEquals": { "aws:PrincipalOrgID": "o-exampleorg" },
"StringEqualsIfExists": { "sns:Protocol": ["sqs", "lambda"] } } }
]
}Flashcards
Quiz
๐ Amazon EventBridge Relaunched Sept 2026
A serverless event router. Applications, 200+ AWS services and SaaS partners publish events; rules or subscribers match on any part of the content and deliver to targets.
๐ฎ The analogy
A big sorting office. Anyone can drop a postcard saying "this happened". Sorters read every postcard and copy it into the trays of whoever asked for that kind of postcard ("all orders over $500", "anything from S3 in bucket X"). The 2026 bus also photocopies every postcard into a binder so teams can catch up later.โ Use it whenโฆ
- Reacting to AWS service or SaaS events
- Routing on event content, not just a topic name
- Many teams/accounts share one event backbone
- You want to add consumers without changing producers
โ ๏ธ Not ideal whenโฆ
- You need a work queue for one consumer (SQS)
- Very high fan-out to people via SMS/email (SNS)
- Massive telemetry streams that need shard-level control (Kinesis/MSK)
Interactive simulators
Two scenarios: the familiar rules & targets model (default bus and "Custom event bus โ classic"), and the new Custom Event Bus. Switch with the buttons at the top of the simulator.
What's new in 2026
January 2026: maximum event payload increased from 256 KB to 1 MB (most commercial Regions).
| Capability | Custom Event Bus (new) | Custom event bus โ classic / default bus |
|---|---|---|
| Routing resource | Subscriber: filter + transformer + one target; created by the consumer | Rule: pattern + up to 5 targets; created by the bus owner |
| Cross-account | Share via AWS RAM (publish / subscribe / attach sources); RevokeResource | Bus resource policy, or forward to a bus in the other account |
| Retention & replay | Built in, 1โ365 days; subscriber starting position; pause/resume | Not retained; archive + replay |
| Ordering | FIFO within an EventGroupId, per subscriber | None |
| De-duplication | At publish time, 5-minute window | None |
| Publish APIs | PutEvents (JSON) + PutRawEvents (Avro, Protobuf, raw) | PutEvents (JSON) |
| Transforms | JSONata | Input transformer |
| Default retry | 5 attempts / 300 s | 185 attempts / 24 h |
| Failure output | DLQ gets a JSON failure record | DLQ gets the event + error attributes |
Deep dive
Event patterns โ the matching language
{
"source": ["com.shop.checkout"],
"detail-type": ["OrderPlaced", "OrderUpdated"],
"detail": {
"total": [{ "numeric": [">=", 500] }],
"country": [{ "anything-but": ["US"] }],
"coupon": [{ "exists": true }],
"email": [{ "suffix": "@example.com" }],
"$or": [ { "tier": ["gold"] }, { "items": [{ "numeric": [">", 10] }] } ]
}
}
Fields are ANDed; values in an array are ORed. Use aws events test-event-pattern to try patterns. On the new bus, the same syntax is used as a subscriber filter with scope DATA (wildcards differ; PutRawEvents payloads aren't nested under detail).
Targets, delivery roles and retries
- Targets include Lambda, SQS, SNS, Step Functions, Kinesis, Firehose, API Gateway, API destinations (any HTTPS API), other event buses, and more. The new bus adds universal targets (
arn:aws:events:::aws-sdk:service:apiAction) to call almost any AWS API. - EventBridge needs permission to call each target: a resource-based policy (Lambda, SNS, SQS) or an IAM delivery role.
- Retries use exponential back-off with jitter. Classic:
MaximumEventAgeInSeconds60โ86,400 (default 86,400) andMaximumRetryAttempts0โ185 (default 185). New bus subscribers: same ranges, defaults 300 s / 5. - Always attach a DLQ: without one, events that exhaust retries are dropped (visible only in metrics).
The wider EventBridge family
- Pipes โ point-to-point: one source (SQS, Kinesis, DynamoDB Streams, MSK, MQโฆ) โ filter โ enrichment (Lambda, Step Functions, API Gateway, API destination) โ one target. You pay only for events that pass the filter.
- Scheduler โ one-time or recurring schedules invoking AWS APIs; the recommended alternative to SQS delays longer than 15 minutes.
- Schema registry โ discover event schemas and generate code bindings.
- Global endpoints โ Regional failover for event ingestion (classic).
Real-world examples
๐ก๏ธ Security automation
An AWS service event such as "security group changed" lands on the default bus. A rule sends it to a Lambda function that checks the change and, if it opens port 22 to the world, reverts it and pages security.
๐งพ SaaS integration
A support-desk SaaS partner sends "ticket escalated" events. A rule starts a Step Functions workflow that pulls customer data and alerts the account manager โ no polling code.
๐ข Company-wide order backbone (new bus)
A platform team runs one shared orders bus. Fulfillment, billing and analytics accounts attach their own subscribers. Billing uses FIFO per order ID; analytics starts 30 days back to backfill a new dashboard.
Code (Python, new eventbridgev2 client)
import boto3, json
eb = boto3.client("eventbridgev2") # new Custom Event Bus API
eb.put_events(
EventBusArn="arn:aws:events:us-east-1:111122223333:event-busv2/orders/EXAMPLE1234567890abcdef",
Entries=[{
"Source": "com.shop.orders",
"DetailType": "OrderShipped",
"Detail": json.dumps({"orderId": "o-1001", "carrier": "UPS"}),
"SystemMetadata": {
"EventGroupId": "o-1001", # FIFO order per order ID
"DeduplicationId": "o-1001-shipped"} # safe to retry
}])
# up to 100 entries per call; PutRawEvents for Avro / Protobuf / raw bytesโฐ Trial-ending reminders
When a user signs up, EventBridge Scheduler creates a one-time schedule for day 27 that invokes a Lambda function to send a "your trial ends soon" email.
Security
Checklist
- ๐ Classic: bus resource policy grants
events:PutEventsto specific accounts or your organization (aws:PrincipalOrgID). - ๐ค New bus: share through AWS RAM with the narrowest managed permission (publish-only, subscribe-only, attach-sources); consumers own their subscribers; owner can
RevokeResource. - ๐ญ Each target/subscriber uses a delivery role scoped to exactly that target action.
- ๐ Encryption at rest is on by default (AWS owned key). Choose a customer managed KMS key for control and CloudTrail visibility; new-bus KMS calls don't grow with event volume.
- โ๏ธ Use input transformers / JSONata to strip PII before third-party targets; API destination credentials are stored in AWS Secrets Manager via connections.
- ๐ Watch for event loops (a target publishing back to the same bus); the new bus reports
LOOP_DETECTED. - ๐ต๏ธ When an SQS DLQ or target trusts
events.amazonaws.com, scope withaws:SourceArn(rule or subscriber ARN).
Example classic bus policy
Any account in the organization may publish, but only with its own source names.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "OrgCanPublish",
"Effect": "Allow",
"Principal": "*",
"Action": "events:PutEvents",
"Resource": "arn:aws:events:us-east-1:111122223333:event-bus/orders",
"Condition": {
"StringEquals": { "aws:PrincipalOrgID": "o-exampleorg" },
"StringLike": { "events:source": ["com.shop.*"] } }
}]
}Flashcards
Quiz
๐งฉ More decoupling services & patterns
SQS, SNS and EventBridge cover most needs. These services handle streams, legacy protocols, workflows, scheduling and delivery.
๐ Amazon Kinesis Data Streams
Plain English: a security-camera recording of data. Everything is kept in order for a while; many apps can watch and rewind independently.
Technical
โ Amazon MSK
Plain English: the same idea as Kinesis, but it's the popular open-source Apache Kafka, run for you.
Technical
๐จ Amazon MQ
Plain English: a classic message broker for older applications, so they can move to AWS without being rewritten.
Technical
๐ AWS Step Functions
Plain English: a recipe card that a conductor follows step by step โ including "wait for the manager to approve" and "undo if payment fails".
Technical
๐ฐ EventBridge Pipes
Plain English: a pipe with a sieve and a seasoning station: take items from one place, keep only the ones you want, add missing info, deliver to one place.
Technical
โฐ EventBridge Scheduler
Plain English: a giant alarm clock that can trigger any AWS action at an exact time or on repeat.
Technical
๐ Amazon Data Firehose
Plain English: a delivery truck that collects streaming data and drops it into storage or analytics tools in batches.
Technical
ฮป Lambda async destinations
Plain English: when a function finishes (or fails) in the background, automatically tell someone.
Technical
Simulator: how a stream differs from a queue
Common decoupling patterns
Fan-out (SNS โ SQS)
One topic, many queues. Each service gets its own durable copy and pace.
Event router (EventBridge)
Producers emit facts; consumers subscribe by content. Teams evolve independently.
Load leveling (SQS)
A queue absorbs bursts so a fragile database or third-party API is called at a safe rate.
Claim-check (S3 + message)
Store large data in S3; send only the pointer. Encrypt the bucket and restrict access.
Saga (Step Functions)
Long business transactions across services, with compensating "undo" steps on failure.
Transactional outbox
Save the change and an outbox row in one transaction, then publish โ e.g., with EventBridge Pipes reading DynamoDB Streams.
Flashcards
Quiz
๐ Security for messaging & events
Messages often carry orders, payments and personal data. Protect them in layers: who can access, how they travel, how they're stored, and how you'd notice a problem.
Defense in depth โ five layers
IAM identity policies + resource policies (queue, topic, bus) ยท least privilege ยท separate producer and consumer roles ยท
aws:PrincipalOrgID ยท AWS RAM for the new EventBridge bus.VPC interface endpoints (PrivateLink) for SQS, SNS and EventBridge ยท
aws:SourceVpce conditions ยท endpoint policies.TLS in transit (deny
aws:SecureTransport=false) ยท encryption at rest: SSE-SQS / SSE-KMS, SNS SSE-KMS, EventBridge AWS-owned or customer managed keys ยท minimize PII with transformers ยท SNS message data protection.Confused-deputy protection with
aws:SourceArn / aws:SourceAccount ยท KMS key policies granting only the needed service principal ยท SNS signature verification on HTTP endpoints.CloudTrail for API activity ยท CloudWatch alarms on DLQ depth, message age, failed invocations ยท SNS delivery-status logs ยท AWS Config rules and Security Hub for encryption and policy drift.
Interactive checklist
Tick what's true for your workload to see your coverage.
Common mistakes
The queue uses the AWS managed key (whose policy you can't edit) or the CMK policy doesn't allow
sns.amazonaws.com. Use a customer managed key and grant the service principal kms:GenerateDataKey and kms:Decrypt.A queue policy with
Principal: * and no conditions. Add aws:SourceArn, aws:PrincipalOrgID or aws:SourceVpce.The whole event was forwarded. Use an input transformer / JSONata to send only what the partner needs.
No DLQ was attached, so retries ran out and events were dropped. Treat DLQs as mandatory and alarm on them.
Example: KMS key policy statement for SNS โ encrypted SQS
{
"Sid": "AllowSNSToUseKeyForOrderQueue",
"Effect": "Allow",
"Principal": { "Service": "sns.amazonaws.com" },
"Action": ["kms:GenerateDataKey", "kms:Decrypt"],
"Resource": "*",
"Condition": { "ArnEquals": {
"aws:SourceArn": "arn:aws:sns:us-east-1:111122223333:order-events" } }
}
Flashcards
Quiz
๐งญ Compare & choose
Side-by-side differences, and a quick decision helper.
Decision helper
Side-by-side
| SQS | SNS | EventBridge (classic) | EventBridge Custom Event Bus (2026) | Kinesis Data Streams | |
|---|---|---|---|---|---|
| Plain English | To-do rail | Loudspeaker | Sorting office | Sorting office that records everything | Recorded log |
| Model | Queue, consumers pull | Pub/sub, push | Event bus, rules push to targets | Event bus, subscribers push to targets | Stream, consumers read |
| Keeps data? | Until deleted (โค14 days) | No | No (archive optional) | Yes, 1โ365 days | Yes, 24 h โ 365 days |
| Receivers per message | One | Many | Many (โค5 targets/rule, many rules) | Many (one target per subscriber) | Many, independent |
| Ordering | FIFO queues | FIFO topics | None | FIFO per EventGroupId | Per shard |
| Duplicates | Standard: possible ยท FIFO: 5-min dedup | Standard: possible ยท FIFO: dedup | Possible | Publish-time dedup (5 min) | Possible (producer retries) |
| Filtering | None (consumer decides) | Filter policy per subscription | Rich event patterns | Rich patterns per subscriber | None (consumer decides) |
| Max payload | 1 MiB | 256 KiB (1 MiB opt-in) | 1 MB | see service quotas | see service quotas |
| Failure handling | Visibility timeout + DLQ | Delivery policy + subscription DLQ | Retry 24 h/185 + DLQ | Retry 300 s/5 + DLQ record | Consumer retries from checkpoint |
| Sweet spot | Background jobs, buffering | Broadcast, notify people | AWS/SaaS events, content routing | Org-wide event backbone across accounts | High-volume telemetry & analytics |
๐ Final exam
15 random questions drawn from every module. Retake for a fresh set.