EventBridge
Links: 101 AWS SAA Index
EventBridge¶
-
These were previously known as CloudWatch Events. We can say EventBridge is the next evolution of CloudWatch. CloudWatch events are still there in the console but it is advised to use EventBridge. Over the time CloudWatch events will be replaced by EventBridge.
-
Event Pattern: Intercept events from AWS services (Sources). Some example sources are EC2 Instance Start, CodeBuild Failure, S3, Trusted Advisor etc.
Every time an Amazon EC2 instance is launched, certain metadata about the instance should be recorded in an Amazon DynamoDB table. The data is gathered and written to the table by an AWS Lambda function. What is the MOST efficient method of invoking the Lambda function?
Create a CloudWatch Event with an event pattern looking for EC2 state changes and a target set to use the Lambda function
- These events can also be generated based on schedule or CRON. For example create and event every 4 hours. Now this can be chained with a lambda function.
- A JSON payload is created from the event and then passed onto the target.
- When we are using EventBridge events we are using the default event bus generated by AWS services.
- We have multiple event buses in EventBridge
- Partner event bus → receive events from SaaS service or applications (Zendesk, DataDog, Segment, Auth0...). This means other services can send events to my AWS account.
- Custom event bus → for our own applications.
- Event buses can be accessed from other AWS accounts as well using resource based policies of EventBridge.
- You can archive events (all/filter) sent to an event bus (indefinitely or set period)
- Ability to replay archived events.
- Useful for debugging specific events.
- We create rules on how we want to process the events.
- EventBridge can analyse the events in your bus and infer the schema.
- The Schema Registry allows us to generate code for our application, that will know in advance how data is structured in the event bus.
- Schema can be versioned
- The main difference between EventBridge and CloudWatch Events are the buses and schema registry.
Go for EventBridge over SQS when the question mentions 3rd SaaS party applications.
SQS works well for decoupling applications. It does not directly integrate with third-party SaaS services.
- Event bridge can be used for multi account aggregation of events:
Last updated: 2023-03-06