EV

Simplifies the configuration of AWS EventBridge buses, rules, and targets for event-driven systems.

Install

mkdir -p .claude/skills/eventbridge && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7757" && unzip -o skill.zip -d .claude/skills/eventbridge && rm skill.zip

Installs to .claude/skills/eventbridge

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
214 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Create custom event buses for applications
  • Define rules with event patterns to route events
  • Add AWS services as targets for matched events
  • Publish custom application events to an event bus
  • Schedule one-time or recurring events
  • Monitor failed event invocations using CloudWatch metrics

How it works

EventBridge receives events from various sources, applies rules with defined patterns to match events, and then routes matched events to configured targets.

Inputs & outputs

You give it
Event data in JSON format, schedule expressions, or rule configurations
You get back
Events routed to specified AWS service targets or scheduled event invocations

When to use eventbridge

  • Create a custom event bus
  • Define event pattern rules for Lambda
  • Configure scheduled events
  • Integrate third-party SaaS events

About this skill

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')

# Create rule
events.put_rule(
    Name='order-created-rule',
    EventBusName='my-app-events',
    EventPattern=json.dumps({
        'source': ['my-app.orders'],
        'detail-type': ['Order Created']
    }),
    State='ENABLED'
)

# Add target
events.put_targets(
    Rule='order-created-rule',
    EventBusName='my-app-events',
    Targets=[{
        'Id': 'process-order',
        'Arn': 'arn:aws:lambda:us-east-1:123456789012:function:ProcessOrder'
    }]
)

Publish Custom Events

import boto3
import json

events = boto3.client('events')

events.put_events(
    Entries=[
        {
            'Source': 'my-app.orders',
            'DetailType': 'Order Created',
            'Detail': json.dumps({
                'order_id': '12345',
                'customer_id': 'cust-789',
                'total': 99.99,
                'items': [
                    {'product_id': 'prod-1', 'quantity': 2}
                ]
            }),
            'EventBusName': 'my-app-events'
        }
    ]
)

Scheduled Events

# Run every 5 minutes
aws events put-rule \
  --name every-5-minutes \
  --schedule-expression "rate(5 minutes)"

# Run at specific times (cron)
aws events put-rule \
  --name daily-cleanup \
  --schedule-expression "cron(0 2 * * ? *)"

# Add target
aws events put-targets \
  --rule every-5-minutes \
  --targets '[{
    "Id": "cleanup-function",
    "Arn": "arn:aws:lambda:us-east-1:123456789012:function:Cleanup"
  }]'

EventBridge Scheduler (One-Time and Flexible)

# One-time schedule
aws scheduler create-schedule \
  --name send-reminder \
  --schedule-expression "at(2024-12-25T09:00:00)" \
  --target '{
    "Arn": "arn:aws:lambda:us-east-1:123456789012:function:SendReminder",
    "RoleArn": "arn:aws:iam::123456789012:role/scheduler-role",
    "Input": "{\"message\": \"Merry Christmas!\"}"
  }' \
  --flexible-time-window '{"Mode": "OFF"}'

# Recurring with flexible window
aws scheduler create-schedule \
  --name hourly-sync \
  --schedule-expression "rate(1 hour)" \
  --target '{
    "Arn": "arn:aws:lambda:us-east-1:123456789012:function:SyncData",
    "RoleArn": "arn:aws:iam::123456789012:role/scheduler-role"
  }' \
  --flexible-time-window '{"Mode": "FLEXIBLE", "MaximumWindowInMinutes": 15}'

AWS Service Events

# EC2 state changes
aws events put-rule \
  --name ec2-state-change \
  --event-pattern '{
    "source": ["aws.ec2"],
    "detail-type": ["EC2 Instance State-change Notification"],
    "detail": {
      "state": ["stopped", "terminated"]
    }
  }'

# S3 object created
aws events put-rule \
  --name s3-upload \
  --event-pattern '{
    "source": ["aws.s3"],
    "detail-type": ["Object Created"],
    "detail": {
      "bucket": {"name": ["my-bucket"]},
      "object": {"key": [{"prefix": "uploads/"}]}
    }
  }'

CLI Reference

Event Buses

CommandDescription
aws events create-event-busCreate event bus
aws events delete-event-busDelete event bus
aws events list-event-busesList event buses
aws events describe-event-busGet event bus details

Rules

CommandDescription
aws events put-ruleCreate or update rule
aws events delete-ruleDelete rule
aws events list-rulesList rules
aws events describe-ruleGet rule details
aws events enable-ruleEnable rule
aws events disable-ruleDisable rule

Targets

CommandDescription
aws events put-targetsAdd targets to rule
aws events remove-targetsRemove targets
aws events list-targets-by-ruleList rule targets

Events

CommandDescription
aws events put-eventsPublish events

Best Practices

Event Design

  • Use meaningful source namescompany.service.component
  • Use descriptive detail-typesOrder Created, User Signed Up
  • Include correlation IDs for tracing
  • Keep events small (< 256 KB)
  • Use versioning for event schemas
# Good event structure
{
    'Source': 'mycompany.orders.api',
    'DetailType': 'Order Created',
    'Detail': json.dumps({
        'version': '1.0',
        'correlation_id': 'req-abc-123',
        'timestamp': '2024-01-15T10:30:00Z',
        'order_id': '12345',
        'data': {...}
    })
}

Reliability

  • Use DLQs for failed deliveries
  • Implement idempotency in consumers
  • Monitor failed invocations
  • Use archive and replay for recovery

Security

  • Use resource policies to control access
  • Enable encryption with KMS
  • Use IAM roles for targets

Cost Optimization

  • Use specific event patterns to reduce matches
  • Batch events when publishing (up to 10 per call)
  • Archive selectively — not all events

Troubleshooting

Rule Not Triggering

Debug:

# Check rule status
aws events describe-rule --name my-rule

# Check targets
aws events list-targets-by-rule --rule my-rule

# Test event pattern
aws events test-event-pattern \
  --event-pattern '{"source": ["my-app"]}' \
  --event '{"source": "my-app", "detail-type": "Test"}'

Common causes:

  • Rule disabled
  • Event pattern doesn't match
  • Target permissions missing

Lambda Not Invoked

Check Lambda permissions:

aws lambda get-policy --function-name MyFunction

Required permission:

{
  "Principal": "events.amazonaws.com",
  "Action": "lambda:InvokeFunction",
  "Resource": "function-arn",
  "Condition": {
    "ArnLike": {
      "AWS:SourceArn": "rule-arn"
    }
  }
}

Events Not Reaching Custom Bus

Check:

  • Publishing to correct bus name
  • Event format is valid JSON
  • Put events has proper permissions
# Test publish
aws events put-events \
  --entries '[{
    "Source": "test",
    "DetailType": "Test Event",
    "Detail": "{}",
    "EventBusName": "my-app-events"
  }]'

Viewing Failed Events

# Enable CloudWatch metrics
aws events put-rule \
  --name my-rule \
  --event-pattern '...' \
  --state ENABLED

# Check FailedInvocations metric
aws cloudwatch get-metric-statistics \
  --namespace AWS/Events \
  --metric-name FailedInvocations \
  --dimensions Name=RuleName,Value=my-rule \
  --start-time $(date -d '1 hour ago' -u +%Y-%m-%dT%H:%M:%SZ) \
  --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
  --period 300 \
  --statistics Sum

References

Limitations

  • Each rule can have up to 5 targets
  • Publishing events is limited to 10 entries per call

How it compares

EventBridge provides a centralized, serverless event bus for routing events between applications and services, unlike direct service-to-service integrations.

Compared to similar skills

eventbridge side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
eventbridge (this skill)17moReviewIntermediate
aws-solution-architect203moReviewAdvanced
terraform-module-library74moNo flagsAdvanced
cloud-architect64moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

aws-solution-architect

alirezarezvani

Design AWS architectures for startups using serverless patterns and IaC templates. Use when asked to design serverless architecture, create CloudFormation templates, optimize AWS costs, set up CI/CD pipelines, or migrate to AWS. Covers Lambda, API Gateway, DynamoDB, ECS, Aurora, and cost optimization.

2047

terraform-module-library

wshobson

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

759

cloud-architect

sickn33

Expert cloud architect specializing in AWS/Azure/GCP multi-cloud infrastructure design, advanced IaC (Terraform/OpenTofu/CDK), FinOps cost optimization, and modern architectural patterns. Masters serverless, microservices, security, compliance, and disaster recovery. Use PROACTIVELY for cloud architecture, cost optimization, migration planning, or multi-cloud strategies.

649

kubernetes-architect

sickn33

Expert Kubernetes architect specializing in cloud-native infrastructure, advanced GitOps workflows (ArgoCD/Flux), and enterprise container orchestration. Masters EKS/AKS/GKE, service mesh (Istio/Linkerd), progressive delivery, multi-tenancy, and platform engineering. Handles security, observability, cost optimization, and developer experience. Use PROACTIVELY for K8s architecture, GitOps implementation, or cloud-native platform design.

636

aws-advisor

tech-leads-club

Expert AWS Cloud Advisor for architecture design, security review, and implementation guidance. Leverages AWS MCP tools for accurate, documentation-backed answers. Use when user asks about AWS architecture, security, service selection, migrations, troubleshooting, or learning AWS. Triggers on AWS, Lambda, S3, EC2, ECS, EKS, DynamoDB, RDS, CloudFormation, CDK, Terraform, Serverless, SAM, IAM, VPC, API Gateway, or any AWS service.

529

windows-builder

hashicorp

Build Windows images with Packer using WinRM communicator and PowerShell provisioners. Use when creating Windows AMIs, Azure images, or VMware templates.

325

Search skills

Search the agent skills registry