Eventbridge
AWS EventBridge serverless event bus for event-driven architectures.
Install
npx skills add itsmostafa/aws-agent-skills --skill eventbridge -g -a claude-code -y- Repository
- itsmostafa/aws-agent-skills1.2k
- Category
- DevOps
- Updated
- 9d ago
- License
- MIT
- Context cost
- Mediumabout 2,237 tokens
- Runs scripts
- No, instructions only
What it does
AWS EventBridge serverless event bus for event-driven architectures. Use when creating rules, configuring event patterns, setting up scheduled events, integrating with SaaS, or building cross-account event routing.
AWS EventBridge
Amazon EventBridge is a serverless event bus that connects applications using events. Route events from AWS services, custom applications, and SaaS partners.
Table of Contents
Core Concepts
Event Bus
Channel that receives events. Types:
- Default: Receives AWS service events
- Custom: Your application events
- Partner: SaaS application events
Rules
Match incoming events and route to targets. Each rule can have up to 5 targets.
Event Patterns
JSON patterns that define which events match a rule.
Targets
AWS services that receive matched events (Lambda, SQS, SNS, Step Functions, etc.).
Scheduler
Schedule one-time or recurring events to invoke targets.
Common Patterns
Create Custom Event Bus and Rule
AWS CLI:
# Create custom event bus
aws events create-event-bus --name my-app-events
# Create rule
aws events put-rule \
--name order-created-rule \
--event-bus-name my-app-events \
--event-pattern '{
"source": ["my-app.orders"],
"detail-type": ["Order Created"]
}'
# Add Lambda target
aws events put-targets \
--rule order-created-rule \
--event-bus-name my-app-events \
--targets '[{
"Id": "process-order",
"Arn": "arn:aws:lambda:us-east-1:123456789012:function:ProcessOrder"
}]'
# Add Lambda permission
aws lambda add-permission \
--function-name ProcessOrder \
--statement-id eventbridge-order-created \
--action lambda:InvokeFunction \
--principal events.amazonaws.com \
--source-arn arn:aws:events:us-east-1:123456789012:rule/my-app-events/order-created-rule
boto3:
import boto3
events = boto3.client('events')
# Create event bus
events.create_event_bus(Name='my-app-events')

