Amazon EventBridge のアイコン

Amazon EventBridge Popular2019年〜

A serverless event bus that routes events from AWS services and SaaS applications

What It Does

Amazon EventBridge receives events (notifications of occurrences) from AWS services, SaaS applications, and custom applications, and routes them to appropriate targets based on rules. For example, EC2 instance state changes, S3 file uploads, and scheduled triggers can be routed to Lambda functions, SQS queues, and more.

Use Cases

It is used for automated processing in response to AWS resource state changes, scheduling periodic batch jobs, integrating with SaaS applications (Zendesk, Datadog, etc.), event-driven architectures between microservices, and application integration through custom events.

Everyday Analogy

Think of it like an airport control tower. The control tower (EventBridge) receives flight information (events) from various airlines (event sources) and directs them to the appropriate runway (target) based on their destination (rules). Without the tower, each airline would need to coordinate individually, but centralized management makes operations efficient.

What Is EventBridge?

Amazon EventBridge is a serverless event bus for building event-driven architectures. An event bus is an infrastructure that mediates between event publishers and subscribers. EventBridge is the successor to CloudWatch Events and can handle events from AWS services, SaaS partners, and custom applications in a unified way.

Rules and Targets

EventBridge rules combine event filtering conditions with targets (delivery destinations). You define event patterns to process only events matching specific conditions. For example, you can set up a rule to send only EC2 instance stop events to a Lambda function. A single rule can have up to 5 targets, supporting over 20 targets including Lambda, SQS, SNS, and Step Functions.

Scheduling

EventBridge Scheduler is a feature for scheduling periodic task execution. You specify execution intervals using cron or rate expressions to periodically run Lambda functions or Step Functions. For example, you can schedule daily data backups at 3 AM or health checks every 5 minutes. It also supports time zone specification and one-time scheduled executions. For comprehensive best practices on scheduling, related books on Amazon are recommended.

Getting Started

To get started, create a rule in the EventBridge console. Select an event source (AWS service or schedule) and define an event pattern. Specify a Lambda function or SQS queue as the target, and matching events are automatically delivered. Creating a schedule rule makes it easy to set up periodic execution like cron jobs.

Things to Watch Out For

  • Custom event publishing costs about $1 per million events, but estimate costs when publishing large volumes
  • Incorrect event patterns may deliver unintended events to targets, so thoroughly test in a development environment
  • Events from AWS services to the default event bus are free
共有するXB!