Skip to main content

EventBridge

Is EventBridge same as CloudWatch?

Amazon EventBridge is the preferred way to manage your events. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features. Changes you make in either CloudWatch or EventBridge will appear in each console. What Is Amazon CloudWatch Events?

Amazon EventBridge is recommended when you want to build an application that reacts to events from SaaS applications and/or AWS services. Amazon EventBridge is the only event-based service that integrates directly with third-party SaaS partners.

You can select the following types of targets when using EventBridge as a part of your AWS Health workflow:

  • AWS Lambda functions
  • Kinesis streams
  • Amazon SQS queues
  • Amazon SNS topics
  • Templated targets (CloudWatch alarm actions)

Templated targets

Templated targets are a set of common API operations across a group of core AWS services, such as Amazon SQS, Lambda, and Step Functions. For example, you can target Lambda's Invoke operation by providing the function ARN, or Amazon SQS's SendMessage operation using the queue ARN.

EBS

target-ebs

You can run CloudWatch Events rules according to a schedule. It is possible to create an automated snapshot of an existing Amazon Elastic Block Store (Amazon EBS) volume on a schedule. You can choose a fixed rate to create a snapshot every few minutes or use a cron expression to specify that the snapshot is made at a specific time of day.

Snapshots are incremental backups, which means that only the blocks on the device that have changed after your most recent snapshot are saved. This minimizes the time required to create the snapshot and saves on storage costs by not duplicating data. Each snapshot contains all of the information that is needed to restore your data (from the moment when the snapshot was taken) to a new EBS volume.

Schedule Automated Amazon EBS Snapshots Using CloudWatch Events

Permission for different targets
  • IAM roles for rules are only used for events related to Kinesis Streams.
  • For Lambda functions and Amazon SNS topics, you need to provide resource-based permissions.

Examples

Monitor API call from CloudTrail then use SNS for notification

To get notified via email when there are API calls like the CreateUser API, you need to work with three services, namely AmazonEvent Bridge (Amazon CloudWatch Events), CloudTrail, and Amazon Simple Notification Service.

You have to create an Amazon SNS topic with email subscriptions. This will allow email subscribers to get notified when a message is published on the topic.

AWS CloudTrail publishes events that you can use as an event source when setting up an Amazon EventBridge rule. With this, you can then set up an Amazon EventBridge rule with CloudTrail as the event source, set CreateUser as the event pattern, and set the SNS topic you just created as the target.