In one of our previous posts, we’ve covered some of the main features of EventBridge. Here, we will talk about another pretty handy feature - SaaS integrations.
We have also displayed some examples of using EventBridge to communicate within our own service, but sometimes we want to integrate a third-party service. Maybe we have an authentication provider like Auth0 or we use DataDog to monitor our app or PagerDuty as an incident platform. In that case, we can use EventBridge to establish communication between those services and our service.
The principle is rather straightforward.
Firstly, we authorize the service we want to integrate with so it can access our EventBridge. The exact flow can vary from service to service, but it’s usually done from the management console of that service - in our example, PagerDuty.
For PagerDuty, it’s under Integration > Extensions. There we can create an EventBridge integration. We specify our AccountID and Region so our PagerDuty can make an integration request to our AWS Account.
We’ll be able to see this request if we go to EventBridge in our AWS Console and navigate to Integrations > Partner event sources.
After we’ve authorized our PagerDuty integration, the EventBus will be created automatically. What’s left for us to do is to create an Event Rule. That’s where we will specify the Event Pattern and Target.
When creating a pattern, we select AWS Events or EventBridge Partner Events. There are preset Event Patterns for partner sources like PagerDuty, DataDog, Auth0…
After we’ve created our pattern, we have to add the Event Target. Some of the most commonly used are Lambda, S3, SNS, StepFunctions… Let’s say we have a Lambda function which would log the data from PagerDuty in CloudWatch. We then select that function as our Event Target and our integration is set up.
In order to test, we have to create an incident in our PagerDuty.
Now we check CloudWatch logs to see the result.
Here you can find a list of integrations verified by AWS.
Here are some really interesting examples of integrations: