Integrating AWS Clean Rooms into event-driven applications using Amazon EventBridge - AWS Clean Rooms

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).

AWS services send events to the EventBridge default event bus. If the event matches a rule's event pattern, EventBridge sends the event to the targets specified for that rule.

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

Analysis Template Created

The Analysis Template owner and all active members of the collaboration are notified when an Analysis Template is Created.

Analysis Template Updated

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.

Analysis Template Deleted

The Analysis Template owner and all active members of the collaboration are notified when an Analysis Template is Deleted.

Collaboration Created

The Collaboration owner is notified when a Collaboration is Created.

Collaboration Updated

The Collaboration owner and all active members of the collaboration that have visibility into the update are notified when a Collaboration is Updated.

Collaboration Change Request Created

The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Created.

Collaboration Change Request Approved

The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Approved.

Collaboration Change Request Cancelled

The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Cancelled.

Collaboration Change Request Committed

The Collaboration owner and all active members of the collaboration are notified when a Collaboration Change Request is Committed.

Configured Table Association Created

The Configured Table Association owner and all active members of the collaboration are notified when a Configured Table Association is Created.

Configured Table Association Updated

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.

Configured Table Association Deleted

The Configured Table Association owner and all active members of the collaboration are notified when a Configured Table Association is Deleted.

Configured Table Association Analysis Rule Created

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.

Configured Table Association Analysis Rule Updated

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.

Configured Table Association Analysis Rule 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 Deleted.

Id Mapping Table Created

The Id Mapping Table owner and all active members of the collaboration are notified when an Id Mapping Table is Created.

Id Mapping Table Updated

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.

Id Mapping Table Deleted

The Id Mapping Table owner and all active members of the collaboration are notified when an Id Mapping Table is Deleted.

Id Namespace Association Created

The Id Namespace Association owner and all active members of the collaboration are notified when an Id Namespace Association is Created.

Id Namespace Association Updated

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.

Id Namespace Association Deleted

The Id Namespace Association owner and all active members of the collaboration are notified when an Id Namespace Association is Deleted.

Invited To Collaboration

The invited member is notified when they are invited to a Collaboration.

Membership Created

The Membership owner and all active members of the collaboration are notified when a Membership is Created.

Membership Updated

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.

Membership Deleted

The Membership owner and all active members of the collaboration are notified when a Membership is Deleted.

Protected Job Submitted

The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Submitted.

Protected Job Started

The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Started.

Protected Job Cancelling

The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Cancelling.

Protected Job Cancelled

The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job is Cancelled.

Protected Job Succeeded

The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job has Succeeded.

Protected Job Failed

The Job Runner, Job Payer and Results Receiver of a Protected Job are notified when the Protected Job has Failed.

Protected Query Submitted

The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Submitted.

Protected Query Started

The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Started.

Protected Query Cancelling

The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Cancelling.

Protected Query Cancelled

The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query is Cancelled.

Protected Query Succeeded

The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query has Succeeded.

Protected Query Failed

The Query Runner, Query Payer and Results Receiver(s) of a Protected Query are notified when the Protected Query has Failed.

Protected Query Timed Out

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 source attribute that identifies the service sending the event. For AWS Clean Rooms events, the source is aws.cleanrooms.

  • (Optional): A detail-type attribute that contains an array of the event names to match.

  • (Optional): A detail attribute 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.