Overview
TheEventBridgeBus construct creates an Amazon EventBridge custom event bus. Route events between microservices with content-based filtering rules.
Import
Basic Usage
Using the Messaging Factory
The recommended way to add EventBridge to a Fjall application is through theMessagingFactory:
Properties
| Property | Type | Default | Description |
|---|---|---|---|
eventBusName | string | Auto-generated | Event bus name |
description | string | EventBus <appName> — Fjall app event bus | Event bus description |
removalPolicy | "DESTROY" | "RETAIN" | "RETAIN" in production, else "DESTROY" | What happens on stack deletion |
Methods
| Method | Returns | Description |
|---|---|---|
getEventBusArn() | string | Event bus ARN |
getEventBusName() | string | Event bus name |
getEventBus() | IEventBus | CDK EventBus construct |
grantPutEventsTo(grantee) | Grant | Grant permission to publish events |
Examples
Custom Event Bus
Event Routing with Rules
Add rules to route events to specific targets:CloudFormation Outputs
| Output | Description |
|---|---|
{id}EventBusArn | Event bus ARN |
{id}EventBusName | Event bus name |
Next Steps
Messaging Factory
Create messaging resources via the factory pattern
Lambda Function
Process events with Lambda
SQS Queue
Buffer and decouple work with a managed queue
SNS Topic
Fan out notifications to multiple subscribers