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.

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.

← Referenced by

Function (publisher)

Function publishes events to this bus. Add a FUNCTION_TO_EVENT_BUS link on the function component. Grants events:PutEvents (AWS) or equivalent to the function's execution identity.

Can reference →

Function (subscriber)

Event bus triggers this function on matching events. Defined via subscriptions in the event bus config — no separate link needed.