Skip to content

CloudWatch EventsΒΆ

  • Event Pattern: Intercept events from AWS services (Sources)
    • Example sources: EC2 Instance Start, CodeBuild Failure, S3, Trusted Advisor
    • Can intercept any API call with CloudTrail integration
  • Schedule or Cron (example: create an event every 4 hours)

  • A JSON payload is created from the event and passed to a target

    • Compute: Lambda, Batch, ECS task
    • Integration: SQS, SNS, Kinesis Data Streams, Kinsesis Data Firehose
    • Orchestration: Step Functions, CodePipeline, CodeBuild
    • Maintenance: SSM, EC2 Actions

In CloudWatch, on the left sidebar there is a section Rules

We can create a new rule

Every time an EC2 instance goes into a pending state, we create an event.

We are going to send an email from SNS with the entire event JSON

The rules that you create in CloudWatch events will also appear on EventBridge.