Integrating AWS Clean Rooms into event-driven applications using Amazon EventBridge
You can incorporate AWS Clean Rooms into event-driven applications (EDAs) that use events that occur in AWS Clean Rooms to communicate between application components and initiate downstream processes. You do this by using Amazon EventBridge to route events from AWS Clean Rooms to other software components. Amazon EventBridge is a serverless service that uses events to connect application components together, making it easier for you to integrate AWS services like AWS Clean Rooms into event-driven architectures without additional code and operations.
Event-driven architecture is a style of building loosely-coupled software systems that work together by emitting and responding to events. In this model, an events represents a change in a resource or environment.
Here's how EventBridge works with AWS Clean Rooms:
As with many AWS services, AWS Clean Rooms generates and sends events to the EventBridge default event bus. An event bus is a router that receives events and routes them to the destinations, or targets, that you specify. Targets can include other AWS services, custom applications, and SaaS partner applications.
EventBridge routes events according to rules you create on the event bus. For each rule, you specify a filter, or event pattern, to select only the events you want. Whenever an event is sent to the event bus, EventBridge compares it against each rule. If the event matches the rule, EventBridge routes the event to the specified target(s).
For example, suppose you want to know every time a new AWS Clean Rooms collaboration is created in
your account. You could create a rule on the default event bus. In the rule you would create
an event pattern that specified events from AWS Clean Rooms named Collaboration
Created. Every time EventBridge received an event matching those properties,
it would route the event to the specified workflow.
AWS Clean Rooms events
AWS services can send events directly to the EventBridge default event bus. In addition, AWS CloudTrail sends events originating from numerous AWS services to EventBridge as well. These events can include API calls, console sign ins and actions, service events, and CloudTrail Insights. For more information, see AWS service events delivered via AWS CloudTrail in the EventBridge User Guide.
For a full list of AWS Clean Rooms events sent to EventBridge, refer to the AWS Clean Rooms topic in the EventBridge Events Reference.
| Event detail type | Description |
|---|---|
| The Analysis Template owner and all active members of the collaboration are notified when an Analysis Template is Created. | |
| The Analysis Template owner and all active members of the collaboration that have visibility into the update are notified when an Analysis Template is Updated. | |
| The Analysis Template owner and all active members of the collaboration are notified when an Analysis Template is Deleted. | |
|
The Collaboration owner is notified when a Collaboration is Created. |
|
|
The Collaboration owner and all active members of the collaboration that have visibility into the update are notified when a Collaboration is Updated. |
|
| The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Created. | |
| The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Approved. | |
| The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Cancelled. | |
| The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Committed. | |
| The Configured Table Association owner and all active members of the collaboration are notified when a Configured Table Association is Created. | |
| The Configured Table Association owner and all active members of the collaboration that have visibility into the update are notified when a Configured Table Association is Updated. | |
| The Configured Table Association owner and all active members of the collaboration are notified when a Configured Table Association is Deleted. | |
| The Configured Table Association Analysis Rule owner and all active members of the collaboration are notified when a Configured Table Association Analysis Rule is Created. | |
| The Configured Table Association Analysis Rule owner and all active members of the collaboration that have visibility into the update are notified when a Configured Table Association Analysis Rule is Updated. | |
| The Configured Table Association Analysis Rule owner and all active members of the collaboration are notified when a Configured Table Association Analysis Rule is Deleted. | |
| The Id Mapping Table owner and all active members of the collaboration are notified when an Id Mapping Table is Created. | |
| The Id Mapping Table owner and all active members of the collaboration that have visibility into the update are notified when an Id Mapping Table is Updated. | |
| The Id Mapping Table owner and all active members of the collaboration are notified when an Id Mapping Table is Deleted. | |
| The Id Namespace Association owner and all active members of the collaboration are notified when an Id Namespace Association is Created. | |
| The Id Namespace Association owner and all active members of the collaboration that have visibility into the update are notified when an Id Namespace Association is Updated. | |
| The Id Namespace Association owner and all active members of the collaboration are notified when an Id Namespace Association is Deleted. | |
| The invited member is notified when they are invited to a Collaboration. | |
| The Membership owner and all active members of the collaboration are notified when a Membership is Created. | |
| The Membership owner is notified when a Membership is Updated, unless the membership was removed from the collaboration in which case all active members of the collaboration are notified. | |
| The Membership owner and all active members of the collaboration are notified when a Membership is Deleted. | |
| The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Submitted. | |
| The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Started. | |
| The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Cancelling. | |
| The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Cancelled. | |
| The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job has Succeeded. | |
| The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job has Failed. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Submitted. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Started. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Cancelling. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Cancelled. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query has Succeeded. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query has Failed. | |
| The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query has Timed Out. |
Routing AWS Clean Rooms events using EventBridge
To have EventBridge route AWS Clean Rooms events to a target, you must create a rule. Each rule contains an event pattern, which EventBridge matches against each event received on the event bus. If the event data matches the specified event pattern, EventBridge routes that event to the rule's target(s).
For comprehensive instructions on creating event bus rules, see Creating rules that react to events in the EventBridge User Guide.
Creating event patterns that match AWS Clean Rooms events
Each event pattern is a JSON object that contains:
-
(Optional): A
sourceattribute that identifies the service sending the event. For AWS Clean Rooms events, the source isaws.cleanrooms. -
(Optional): A
detail-typeattribute that contains an array of the event names to match. -
(Optional): A
detailattribute containing any other event data on which to match.
For example, the following event pattern matches against all Id Namespace Association Updated events where the collaboration was deleted from AWS Clean Rooms:
{ "source": ["aws.cleanrooms"], "detail-type": ["Id Namespace Association Updated"], "detail": { "status": ["COLLABORATION_DELETED"] } }
For more information on writing event patterns, see Event patterns in the EventBridge User Guide.