Event Bus Component
Provisions an event bus for asynchronous, decoupled communication between functions. Functions publish events to the bus; other functions subscribe to receive them.
Configuration Fields
Field | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | required | — | Must be "event-bus" |
name | string | required | — | Unique component name. |
subscriptions | array | optional | — | Event subscriptions. Each subscription routes matching events to a function. See below. |
Subscription Object
Field | Type | Required | Default | Description |
|---|---|---|---|---|
eventType | string | required | — | Event type pattern to match (e.g. order.created). No duplicate (eventType, function) pairs allowed. |
function | string | required | — | Name of the function component to invoke for matching events. |
batchSize | integer | optional | 1 | Number of events delivered per invocation. Must be ≥ 1. |
retryAttempts | integer | optional | 2 | Number of retry attempts on failure. Must be ≥ 0. |
Subscriber functions are declared via the subscriptions array on the event bus itself. You do not need to add them to links — the subscription definition is sufficient. Use a FUNCTION_TO_EVENT_BUS link on the publishing function to declare it publishes to this bus.
Cloud Resources Created
- EventBridge Custom Event Bus — named {derived-name}.
- EventBridge Rules — one per subscription, matching on detail-type.
- Lambda Targets — each rule targets the subscribed function.
- Lambda Permission — grants EventBridge permission to invoke the target function.
- Event Grid Custom Topic — named {derived-name}, provisioned via azure-resourcemanager-eventgrid. Creation is idempotent — an already-existing topic is treated as success.
- Event Grid Subscriptions — one per subscription, filtering on event type.
- Azure Function Endpoint — each subscription targets the subscribed function.
- Pub/Sub Topic — named {derived-name}, provisioned via google-cloud-pubsub. Creation is idempotent — an already-existing topic is treated as success.
- Pub/Sub Subscriptions — one per subscription with push delivery to the target Cloud Function.
- IAM Binding — grants Pub/Sub permission to invoke the target function.
JSON Example
{
"type": "event-bus",
"name": "domain-events",
"subscriptions": [
{
"eventType": "order.created",
"function": "event-processor",
"batchSize": 10,
"retryAttempts": 3
},
{
"eventType": "user.registered",
"function": "event-processor",
"batchSize": 1,
"retryAttempts": 2
}
]
}
Links
The event bus is referenced by publishing functions via a FUNCTION_TO_EVENT_BUS link. Subscriber functions are wired via the subscriptions array on the event bus itself.