eventbridge
/eventbridge
Amazon EventBridge is AWS's serverless event bus: it routes events from AWS services, SaaS apps and your own code to targets using pattern-matching rules. Use when a user wants to publish custom events, write event patterns, add dead-letter queues or input transformers, replay an archive, or run something on a schedule (EventBridge Scheduler).
- Author
- TerminalSkills ↗
- Repository
- skills ↗
- Licence
- Apache-2.0
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Amazon EventBridge is AWS's serverless event bus: it routes events from AWS services, SaaS apps and your own code to targets using pattern-matching rules. Use when a user wants to publish custom events, write event patterns, add dead-letter queues or input transformers, replay an archive, or run something on a schedule (EventBridge Scheduler).
Original author description
Amazon EventBridge is AWS's serverless event bus: it routes events from AWS services, SaaS apps and your own code to targets using pattern-matching rules. Use when a user wants to publish custom events, write event patterns, add dead-letter queues or input transformers, replay an archive, or run something on a schedule (EventBridge Scheduler).
How it works
- Overview
- Instructions
- Examples
- Guidelines
SKILL.md preview
---
name: eventbridge
description: >-
Amazon EventBridge is AWS's serverless event bus: it routes events from AWS
services, SaaS apps and your own code to targets using pattern-matching
rules. Use when a user wants to publish custom events, write event
patterns, add dead-letter queues or input transformers, replay an archive,
or run something on a schedule (EventBridge Scheduler).
license: Apache-2.0
compatibility: 'AWS account; AWS CLI v2; Node.js 18+ for the SDK examples'
metadata:
author: terminal-skills
version: 1.1.0
category: devops
repository: https://github.com/aws/aws-sdk-js-v3
tags: "aws, events, serverless, event-driven, integration"
---
# Amazon EventBridge — Serverless Event Bus
## Overview
EventBridge receives events (JSON with `source`, `detail-type`, `detail`), matches them against rules on an event bus, and delivers matches to targets such as Lambda, SQS, Step Functions or API destinations. Producers do not know who consumes. Use a custom bus per application; the default bus carries AWS service events.
For schedules, AWS now recommends EventBridge Scheduler (`AWS::Scheduler::Schedule`); scheduled rules on a bus are marked legacy in the user guide.
## Instructions
### Publish events
```bash
npm install @aws-sdk/client-eventbridge
```
`PutEvents` does not throw when individual entries fail. Check `FailedEntryCount` and retry only the failed entries.
```typescript
import { EventBridgeClient, PutEventsCommand } from "@aws-sdk/client-eventbridge";
const eb = new EventBridgeClient({ region: "us-east-1" });
export async function publishOrderCreated(order: { orderId: string; userId: string; total: number }) {
const res = await eb.send(new PutEventsCommand({
Entries: [{
Source: "myapp.orders",
DetailType: "OrderCreated",
Detail: JSON.stringify(order),
EventBusName: "my-app-bus",
}],
}));
if (res.FailedEntryCount) {
const failed = res.Entries?.filter(e => e.ErrorCode);
throw new Error(`PutEvents failed: ${JSON.stringify(failed)}`);
}
}
```
Limits: the PutEvents guide allows up to 10 entries per request and under 1 MB total request size; the quotas page lists a higher per-request entry range, so chunk batches (10 is always safe). `Source` values starting with `aws.` are reserved.
### Rules, patterns, DLQ (CloudFormation / SAM)
```yaml
Resources:
OrderBus:
Type: AWS::Events::EventBus
Properties:
Name: my-app-bus
DeadLetterQueue:
Type: AWS::SQS::Queue
DeadLetterQueuePolicy: # EventBridge may not write to the queue without this
Type: AWS::SQS::QueuePolicy
Properties:
Queues: [!Ref DeadLetterQueue]
PolicyDocument:
Statement:
- Effect: Allow
Principal: { Service: events.amazonaws.com }
Action: sqs:SendMessage
Resource: !GetAtt DeadLetterQueue.Arn
Condition:
ArnEquals: { "aws:SourceArn": !GetAtt HighValueOrderRule.Arn }
HighValueOrderRule:
Type: AWS::Events::Rule
Properties:
EventBusName: !Ref OrderBus
EventPattern:
source: ["myapp.orders"]
detail-type: ["OrderCreated"]
detail:
total: [{ "numeric": [">=", 1000] }]
Targets:
- Arn: !GetAtt HighValueProcessor.Arn
Id: high-value-processor
RetryPolicy: { MaximumRetryAttempts: 10, MaximumEventAgeInSeconds: 3600 }
DeadLetterConfig: { Arn: !GetAtt DeadLetterQueue.Arn }
HighValueInvokePermission: # Lambda targets need a resource policy
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref HighValueProcessor
Action: lambda:InvokeFunction
Principal: events.amazonaws.com
SourceArn: !GetAtt HighValueOrderRule.Arn
AnalyticsRule:
Type: AWS::Events::Rule
Properties:
EventBusName: !Ref OrderBus
EventPattern:
source: [{ "prefix": "myapp." }]
Targets:
- Arn: !GetAtt AnalyticsStream.Arn
Id: analytics
RoleArn: !GetAtt AnalyticsStreamRole.Arn
InputTransformer:
InputPathsMap:
orderId: "$.detail.orderId"
total: "$.detail.total"
time: "$.time"
InputTemplate: '{"event_time": "<time>", "order_id": "<orderId>", "amount": <total>}'
```
Default retry is up to 185 attempts over 24 hours (`MaximumRetryAttempts` 0-185, `MaximumEventAgeInSeconds` 60-86400). A DLQ only catches events that exhaust retries. Targets other than Lambda, SNS and SQS (Kinesis, Step Functions) need `RoleArn`. The AWS-level pattern operators include `prefix`, `suffix`, `anything-but`, `numeric`, `exists`, `wildcard`, `equals-ignore-case`.
### Schedules: use EventBridge Scheduler
```yaml
DailyReportSchedule:
Type: AWS::Scheduler::Schedule
Properties:
ScheduleExpression: "cron(0 9 * * ? *)"
ScheduleExpressionTimezone: "Europe/Berlin"
FlexibleTimeWindow: { Mode: "OFF" }
Target:
Arn: !GetAtt DailyReportFunction.Arn
RoleArn: !GetAtt SchedulerInvokeRole.Arn
```
Scheduler takes a time zone and one-time `at(2026-12-01T09:00:00)` schedules; the old `AWS::Events::Rule` with `ScheduleExpression` still works but is legacy.
### Lambda consumer
```typescript
import type { EventBridgeEvent } from "aws-lambda"; // npm i -D @types/aws-lambda
type OrderDetail = { orderId: string; userId: string; total: number };
export async function handler(event: EventBridgeEvent<"OrderCreated", OrderDetail>) {
console.log(event.id, event["detail-type"], event.detail.orderId);
await sendConfirmationEmail(event.detail.userId, event.detail.orderId);
}
```
Use `event.id` as an idempotency key: delivery is at least once.
## Examples
### Example 1: "Alert me when any order over 1000 is created"
Publish with `publishOrderCreated({ orderId: "ord-7731", userId: "usr-204", total: 1499.0 })`. The `HighValueOrderRule` above matches because `total >= 1000`, invokes `HighValueProcessor`, and after exhausted retries parks the event in `DeadLetterQueue`. A 49.99 order does not match and produces no invocation.
### Example 2: "Replay last week's events after a bug fix"
```bash
aws events create-archive --archive-name orders-archive \
--event-source-arn arn:aws:events:us-east-1:123456789012:event-bus/my-app-bus \
--retention-days 30
aws events start-replay --replay-name fix-2026-10-24 \
--event-source-arn arn:aws:events:us-east-1:123456789012:archive/orders-archive \
--destination '{"Arn":"arn:aws:events:us-east-1:123456789012:event-bus/my-app-bus"}' \
--event-start-time 2026-10-17T00:00:00Z --event-end-time 2026-10-24T00:00:00Z
```
Events must have been archived before the replay window.
## Guidelines
- Check `FailedEntryCount` on every PutEvents call; a 200 response does not mean all entries were accepted.
- Create a custom bus per application and grant cross-account access with a bus resource policy.
- Put a DLQ and a retry policy on each target, and the queue policy that lets EventBridge write to it.
- Keep consumers idempotent; duplicates and out-of-order delivery happen.
- A rule matches only what its pattern spells out; test patterns with `aws events test-event-pattern` before deploying.
- Not a queue or stream: for ordered, high-throughput processing use SQS FIFO or Kinesis. For point-to-point scheduling prefer EventBridge Scheduler.
Files in this package (2)
- SKILL.md 7 KB
- _scores.json 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · TerminalSkills/skills | 100 | Apache-2.0 |
| itsmostafa/aws-agent-skills | 100 | MIT |
Database snapshot: 13.11.2026 · package version 4bbc1573b0fb (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100eventbridge-rule-creator
Create eventbridge rule creator operations. Auto-activating skill for AWS Skills. Triggers on: eventbridge rule creator, eventbridge rule creator Part of the AWS Skills skill category. Use when working with eventbridge rule creator functionality. Trigger with phrases like… - 90aws-lambda
Design, build, deploy, test, and debug serverless applications with AWS Lambda. Triggers on phrases like: Lambda function, event source, serverless application, API Gateway, EventBridge, Step Functions, serverless API, event-driven architecture, Lambda trigger. For deploying… - 85aws-lambda
Design, build, deploy, test, and debug serverless applications with AWS Lambda. Triggers on phrases like: Lambda function, event source, serverless application, API Gateway, EventBridge, Step Functions, serverless API, event-driven architecture, Lambda trigger. For deploying… - 100messaging
Deep-dive into AWS messaging services including SQS, SNS, and EventBridge. Use when designing event-driven architectures, choosing between messaging services, configuring queues and topics, implementing fan-out patterns, setting up dead-letter queues, or troubleshooting message delivery issues. - 85aws-serverless
Builds, deploys, manages, debugs, configures, and optimizes serverless applications on AWS using Lambda, API Gateway, Step Functions, EventBridge, and SAM/CDK. Covers cold starts, CORS debugging, event source mappings, troubleshooting, concurrency, SnapStart, Powertools,… - 100aws-eventbridge-webhooks
Receive and authenticate Amazon EventBridge API destination webhooks. Use when setting up an endpoint that EventBridge calls from a rule or pipe, checking the Basic Authorization header, debugging 401s, or handling events by source and detail-type such as EC2 Instance State-change Notification.