Amazon EventBridge

A serverless event bus that routes events from AWS services, SaaS applications, and custom applications, serving as the backbone of event-driven architectures

Overview

Amazon EventBridge (formerly CloudWatch Events) is a serverless event bus that loosely couples event sources with event targets. It filters events from AWS services (EC2 instance state changes, S3 object creation, CodePipeline deployment results, etc.), SaaS partners (Zendesk, Datadog, Auth0, etc.), and custom applications based on rules, routing them to over 20 targets including Lambda, SQS, SNS, Step Functions, and API Gateway. Event pattern matching allows you to process only events that match specific conditions.

Event Bus and Rule Design

An EventBridge event bus is a channel through which events flow. The default event bus receives AWS service events, custom event buses receive application-specific events, and partner event buses receive SaaS partner events. Rules route events to targets based on event patterns (JSON filter conditions) or schedules (cron expressions). Event patterns can filter on event source, type, and detail field values. A rich set of filtering operators is available, including prefix match, suffix match, numeric range, and existence checks. Each rule can have up to 5 targets, enabling fan-out patterns that deliver a single event to multiple targets simultaneously.

Scheduler and Pipes

EventBridge Scheduler generates events on a schedule defined by cron or rate expressions. It succeeds CloudWatch Events cron rules and offers more flexible scheduling. Features include one-time schedules (execute once at a specific date and time), timezone specification, and flexible time windows (execute randomly within a specified time range). EventBridge Pipes simplifies point-to-point integration from source to target. It retrieves events from sources such as SQS queues, Kinesis streams, and DynamoDB streams, applies optional filtering and enrichment (transformation via Lambda), and delivers them to targets. Pipes lets you build integrations like SQS to Lambda to Step Functions without Lambda glue code.

Usage Patterns in Practice

The most common use of EventBridge is automation based on AWS service events: notifying Slack when an EC2 instance enters the terminated state, automatically modifying security groups when GuardDuty detects a threat, or alerting the team when a CodePipeline deployment fails. In microservices architectures, an event-driven pattern using the event bus for inter-service communication is recommended. For example, an order service publishes an "order confirmed" event to EventBridge, and the inventory service, payment service, and notification service each independently process the event. The Azure equivalent is Azure Event Grid, which similarly enables event-driven architectures. For a systematic study of EventBridge from basics to advanced topics, books (Amazon) are a great resource.

共有するXB!