Skip to main content
In this lesson we examine event-driven architectures using Amazon EventBridge and Amazon SNS for real‑time incident detection, routing, and notification. Together these services enable scalable, reliable, and automated incident workflows: EventBridge provides intelligent routing, filtering, transformation, and cross-account integration; SNS provides durable, multi‑protocol fan‑out delivery with subscription filtering and retry semantics.
This guide covers core concepts, common integration patterns, limits to consider, cross-account routing, DLQs, transformers, archives & replay, EventBridge Pipes, message attributes, monitoring, costs, and security best practices. Links to AWS docs are included for deeper reference.
A presentation slide titled "Amazon EventBridge and SNS for Event Processing and Notification." It shows a three-step flow: EventBridge filters events → SNS fan-out notifications → automated, real-time incident workflows.

EventBridge: core concepts

EventBridge provides an event bus that receives and routes events, rules that match patterns against events, and targets that act on matched events. Use EventBridge when you need centralized routing, transformation, cross-account/event‑driven workflows, or complex pattern matching.
A slide titled "Amazon EventBridge Core Concepts" showing four colored blocks labeled Event Bus, Event, Rule, and Target. The Event Bus block includes the note "Central pipeline for receiving and routing events."
Important default EventBridge limits (adjustable via AWS support requests):
A slide titled "Amazon EventBridge Core Concepts" with a header "Critical Limits to Remember." It shows three limits: 300 rules per event bus, 5 targets per rule, and a 64 KB maximum event size.
Event pattern matching commonly targets fields such as source, detail-type, and nested values inside detail. Example EventBridge rule pattern fragments:
For more on event patterns and JSON matching, see the AWS EventBridge documentation: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html

SNS: core concepts and delivery

SNS provides topics and multi‑protocol subscribers (HTTP/S webhook, email, SMS, Lambda, SQS, mobile push). Key features include massive scaling, subscription filter policies based on message attributes, and support for Standard and FIFO topics.
A presentation slide titled "Amazon SNS Core Concepts" with a section called "Massive Scale Capabilities." It lists features like support for up to 12.5M subscriptions per topic, unlimited topics per AWS account, and scalable delivery models (Standard and FIFO).
SNS is ideal when you need multi‑protocol fan‑out (same message delivered to many endpoints). Use message attributes and subscription filter policies to reduce downstream processing and save costs.

Common integration pattern

A typical pattern in incident response:
  1. An event source (e.g., EC2 state change) publishes to EventBridge.
  2. An EventBridge rule matches and forwards to an SNS topic (optionally transforming the payload).
  3. SNS fans out to subscribers: humans (email/SMS), webhooks, SQS queues for workers, or Lambda functions for automated remediation.
EventBridge handles intelligent filtering, pattern matching, and transformations; SNS handles durable, multi‑protocol delivery and fan‑out.
A slide titled "EventBridge + SNS Integration Pattern" showing two side-by-side boxes. The left lists EventBridge features (intelligent filtering, pattern matching, event transformation, routing logic) and the right lists SNS features (multi‑protocol delivery, fan‑out capability, message filtering, retry logic).
Example: an EC2 instance state change triggers an EventBridge rule that sends an alert to SNS. SNS then notifies the on‑call team and triggers a Lambda to attempt automated remediation.
A simple flow diagram titled "EventBridge + SNS Integration Pattern" showing an EC2 instance failure triggering an EventBridge rule, which forwards to SNS and then sends alerts to Email, SMS, and a Lambda function.

Fan‑out architecture patterns

  • Simple fan‑out: SNS -> multiple subscriptions (notification-centric).
  • Processing fan‑out: EventBridge -> multiple Lambda functions (processing-centric).
  • Hybrid: use EventBridge for routing/filters and SNS for broad multi‑protocol delivery.
A slide titled "Event-Driven Fan-Out Architecture Patterns" showing two boxes: "Simple Fan-Out — SNS -> Multiple subscriptions" and "Processing Fan-Out — EventBridge -> Multiple Lambda functions."

SNS subscription filter policies and attributes

SNS message attributes are key/value metadata separate from the message body; they enable efficient filtering and prevent subscribers from receiving irrelevant messages. Limits and types:
  • Up to 10 message attributes per message.
  • Supported attribute types: String, Number, Binary.
  • Maximum total message size (SNS + SQS) is 256 KB.
A slide titled "SNS Message Attributes" with four panels explaining: what they are (metadata key–value pairs added to an SNS message), why use them (enable filtering without reading the message body), supported data types (String, Number, Binary, string array), and limits (up to 10 attributes; 256 KB total).
Example message with attributes:
Example filter policies:
Attributes are case-sensitive. Use descriptive attribute names to keep policies readable and maintainable.

Cross-account event routing (centralized monitoring)

Centralized event monitoring often requires events to flow from multiple AWS accounts into a central account for unified rules, alerting, and remediation. Typical components:
  • Central account: create a custom EventBridge event bus (destination).
  • Central account: add a resource-based policy on the destination bus to allow source accounts to PutEvents.
  • Source accounts: grant IAM permissions to PutEvents to the central bus.
  • Central account: create rules on the centralized bus for monitoring and remediation.
Centralizing events provides consistent rule application and a single pane of glass for security operations.
A presentation slide titled "Cross-Account Event Routing" describing centralized monitoring. It explains multiple AWS accounts send security events to a central EventBridge bus so security teams can monitor from one location and enforce consistent rules.
Typical configuration steps:
A presentation slide titled "Cross-Account Event Routing" listing "Configuration Steps." It shows a row of colorful chevron arrows with brief labels for steps like creating a custom event bus, configuring IAM roles/PutEvents permissions, adding resource policies, and creating rules for unified monitoring.

Dead‑letter queues (DLQs) and error handling

DLQs preserve messages that repeatedly fail delivery so you can investigate and reprocess them. Typical flow: initial delivery attempts → automatic retries (with exponential backoff) → after retry exhaustion route to DLQ.
A presentation slide titled "Dead Letter Queues and Error Handling" showing two panels comparing EventBridge DLQs and SNS DLQs with bullet-point examples of common failures (e.g., throttled Lambda invocations, API Gateway errors, HTTP timeouts, SQS unavailable).
A slide titled "Dead Letter Queues and Error Handling" showing a flow diagram of message processing: initial delivery, failure detected, automatic retry attempts, and final routing to a dead-letter queue after retries are exhausted.
DLQ best practices:
  • Configure retry policies and exponential backoff before relying on DLQs.
  • Use SQS queues as DLQs so they can be polled and processed.
  • Monitor DLQ metrics (queue depth, message age) and alert on thresholds.
  • Retain messages long enough for investigation, but implement retention policies to avoid indefinite storage.
A presentation slide titled "Dead Letter Queues and Error Handling" that lists "DLQ Best Practices." It shows four numbered cards: "Configure retry policies first," "Use SQS queues as DLQs," "Monitor DLQs proactively," and "Set appropriate retention."
Always ensure DLQs are monitored and have an automated or manual process to process and clear messages — DLQs should not be a garbage sink.

Input transformers, archives, and replay

  • Input transformers: reshape event content before delivery to targets to improve readability, remove sensitive data, or add contextual fields (environment/team). Example: transform an EC2 state-change event into a concise human-readable alert.
Original event:
Transformed alert (text):
  • Archives & replay: archive events from a bus and replay them later for testing, reprocessing after an outage, debugging, or disaster recovery. Archives can retain events from one day to indefinitely.
A slide titled "Event Replay and Archive" showing two labeled panels: "Archive" (Events captured; Events stored for analysis) and "Replay" (Replay events on demand; Process historical events).
To replay events:
  1. Create an archive for the event bus.
  2. Ensure events are captured into that archive.
  3. Initiate a replay to a chosen target for reprocessing or testing.
A slide titled "Event Replay and Archive" showing a three-step flow in blue tiles: "Create archive" → "Events captured" → "Initiate replay," each with a simple icon. The design includes arrows between steps and a small © KodeKloud notice.
Common archive & replay use cases: testing/debugging, disaster recovery, and data backups.
A presentation slide titled "Event Replay and Archive" listing three common use cases—Testing and Debugging, Disaster Recovery, and Data Backups—each with a short explanatory note. The slide includes a © Copyright KodeKloud mark in the corner.

EventBridge Pipes (point‑to‑point flows)

EventBridge Pipes simplify dedicated, low‑latency one‑to‑one integrations between supported sources and targets without using the bus. Pipes support filtering, enrichment, batching, ordering for FIFO sources, and DLQs.
A flow diagram titled "EventBridge Pipes for Point-to-Point Integration" showing four stages: Source, Filter, Enrichment, and Target. Each stage lists example AWS services (e.g., SQS, Kinesis, DynamoDB Streams, Lambda, API Gateway, ECS, SNS).
Key Pipe capabilities:
A slide titled "EventBridge Pipes for Point-to-Point Integration" showing three key capabilities: 01 Batching (optimized batch processing for streams and queues), 02 Ordering (maintains message order for Kinesis/SQS FIFO), and 03 Dead‑Letter Queue (captures failed messages).

Monitoring recommendations

Track these metrics and logs to maintain observability and SLOs: Use CloudWatch Alarms and centralized dashboards for alerting; enable AWS X-Ray for distributed tracing where supported.
A slide titled "Monitoring EventBridge and SNS" showing three donut charts labeled NumberOfMessagesPublished (100%), NumberOfNotificationsFailed (5%), and NumberOfNotificationsDelivered (95%). The middle chart is mostly gray while the left and right charts are filled blue.

Cost considerations and optimization

High-level cost drivers:
  • EventBridge: charged per published event.
  • SNS: charged per request/delivery; cost varies by protocol and destination volume.
  • Target executions (Lambda invocations, API calls) are often the dominant cost.
Cost optimization tips:
  • Filter at EventBridge so only relevant events reach downstream services.
  • Use SNS message filtering to reduce fan‑out where possible.
  • Batch events for targets that support batching.
  • Reduce unnecessary downstream processing; prefer direct webhooks for low‑latency, low‑volume targets when appropriate.
A presentation slide titled "Cost Optimization for EventBridge and SNS" showing a pricing breakdown. It lists EventBridge (1 per 1M events), SNS Standard (first 1M free then pay per request), SNS FIFO (0.30 per 1M) and "Target Execution" noted as the biggest cost driver.

Security best practices

  • Apply resource‑based policies and least‑privilege IAM for access control.
  • Encrypt SNS topics and sensitive data at rest using KMS.
  • Isolate event buses for different teams/environments to reduce blast radius.
  • Enable CloudTrail and centralized logging for auditability.
A presentation slide titled "Cost Optimization for EventBridge and SNS" showing five numbered strategy boxes. The strategies are: filter at EventBridge before SNS, implement SNS message filtering, batch events when possible, optimize target execution, and use appropriate delivery methods.
A slide titled "Security Best Practices" showing five numbered recommendations: Resource-Based Access, Encrypt SNS Topics, Separate Event Buses, Least Privilege IAM, and CloudTrail Logging. Each card includes a short note (e.g., use KMS, isolate tenants, grant minimal IAM permissions, and enable logging for audits).

Schema Registry

Enable schema discovery on an EventBridge bus to automatically generate JSON/OpenAPI schemas from observed events. The registry provides versioned schemas and downloadable language-specific code bindings to make development more type-safe and consistent.
A clean infographic titled "EventBridge Schema Registry" showing a horizontal flow of blue arrows that illustrate the steps: Enable Discovery, Events Flow, Schema Generated, and Code Bindings. Each step has a brief caption describing schema discovery, event analysis, automatic JSON/OpenAPI schema creation, and downloadable language-specific code.

When to use EventBridge vs SNS vs SQS

A slide titled "EventBridge vs SNS vs SQS – When to Use Which" showing a "Service Decision Matrix." It compares three panels: EventBridge (routing, filtering, integrations), SNS (fan-out, multi‑protocol, notifications), and SQS (async processing, buffering, ordering/FIFO).
Common serverless pattern: EventBridge routes events → SNS fans out → SQS buffers for workers → Lambda processes messages.
A diagram titled "EventBridge vs SNS vs SQS – When to Use Which" showing a flow: EventBridge routes events → SNS for fan-out → SQS as a buffer → Lambda to process.
Real-world examples:
  • EC2 → EventBridge → SNS → Notify on‑call for instance state changes.
  • API Gateway → SNS → SQS (FIFO) → Lambda for order processing.
A diagram titled "EventBridge vs SNS vs SQS – When to Use Which" showing two real-world flows. The top row shows EC2 → EventBridge → SNS → Notify for EC2 state changes, and the bottom row shows API → SNS → SQS (FIFO) → Lambda for order processing.

Key takeaways

  1. EventBridge is the intelligent event router — use it for complex routing, filtering, transformations, and integrations.
  2. SNS is the multi‑protocol fan‑out notification system — ideal when many endpoints or different protocols need the same message.
  3. Combine EventBridge and SNS for powerful event-driven architectures (filter at the bus, fan out with SNS).
  4. Be aware of limits: ~300 rules per bus, 5 targets per rule, millions of subscribers per topic (varies), 10 message attributes per message, 64 KB event max, and 256 KB SNS/SQS message max.
  5. Use DLQs, input transformers, archives & replay, Pipes, and the Schema Registry to build reliable, testable, and maintainable systems.
A presentation slide titled "Key Takeaways: EventBridge and SNS" listing five numbered points summarizing EventBridge as an intelligent event router, SNS as a multi-protocol fan-out, combining them for architectures, limits, and automated incident response. The slide is branded © KodeKloud.
EventBridge sees most AWS events and works well as the central piece of event‑driven incident response. Use the patterns and best practices in this guide to design resilient, cost‑effective, and secure event-driven architectures. Further reading and references:

Watch Video