All Products
Search
Document Center

EventBridge:Route events to Function Compute

Last Updated:Mar 11, 2026

EventBridge event rules filter events from a custom event bus and route them to Function Compute (FC) for serverless processing. This enables event-driven architectures where incoming events automatically trigger function execution without managing infrastructure.

This topic walks you through adding a custom event source, creating an event rule with FC as the target, publishing a test event, and verifying the result in FC logs.

Prerequisites

Before you begin, make sure that you have:

Step 1: Add a custom event source

  1. Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.

  2. In the top navigation bar, select a region. On the Event Buses page, click the name of the custom event bus that you want to manage.

  3. In the left-side navigation pane, click Event Sources, and then click Add Event Source.

  4. In the Add Custom Event Source panel, configure the Name and Description parameters, select Custom Application from the Event Provider drop-down list, and then click OK.

Step 2: Create an event rule

Important

The event target must reside in the same region as the event rule.

  1. Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.

  2. In the top navigation bar, select a region. On the Event Buses page, click the name of the event bus that you want to manage.

  3. In the left-side navigation pane, click Event Rules. On the page that appears, click Create Rule.

  4. Complete the Create Rule wizard:

    1. Configure Basic Info -- Enter a rule name in the Name field and a description in the Description field. Click Next Step.

    2. Configure Event Pattern -- Set Event Source Type to Custom Event Source and select the event source you added in Step 1 from the Event Source drop-down list. In the Pattern Content code editor, specify an event pattern, and then click Next step.

      For event pattern syntax, see Event patterns.

    3. Configure Targets -- Configure the event target with the following parameters, and then click Create.

      Note

      Each event rule supports up to five event targets.

      Parameter

      Description

      Default

      Service type

      Select Function Compute.

      -

      Function

      Select the function you created in the prerequisites.

      -

      Event

      Choose how the event payload is delivered to the function: Complete Event, Partial Event, Fixed Value, or Template. In this example, Template is selected. For details, see Event transformation.

      -

      Version and Alias

      Select Specified Version or Specified Alias, and then configure the corresponding Version or Alias parameter.

      -

      Execution Method

      Select Synchronous or Asynchronous. Synchronous: FC processes the event and returns the result before the invocation completes. Asynchronous: FC persists the request and returns a response immediately without waiting for execution to finish. For details, see Synchronous invocations and Asynchronous invocations.

      -

      Event Format

      (Optional) Select the format in which events are delivered to the function. Object: events delivered as JSON objects. ObjectList: events delivered as JSON arrays.

      Object

      Retry Policy and Dead-letter Queue

      Configure retry behavior and an optional dead-letter queue. For details, see Retry policies and dead-letter queues.

      -

      Event template example

      If you select Template, define variables that extract fields from the event and a template string that references them.

      Sample variables:

      {
        "source": "$.source",
        "type": "$.type"
      }

      Sample template:

      The event comes from ${source},event type is ${type}.

Step 3: Publish an event

Note

The EventBridge console only supports publishing events to custom event buses.

  1. Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.

  2. In the top navigation bar, select a region.

  3. On the Event Buses page, find the target event bus, and then click Publish Event in the Operations column.

  4. In the Publish Event to Custom Event Bus panel, select a custom event source from the Custom Event Source drop-down list, enter the event content in the Event Body code editor, and then click OK.

    For event field definitions, see Event overview.

Note

To automatically retry a failed event, define exception-handling logic in your function. When EventBridge detects an exception thrown by the function, it republishes the event to FC.

Verify the results

Confirm that the event was received and processed by checking the function logs in FC.

  1. Log on to the Function Compute console.

  2. In the left-side navigation pane, click Functions. In the top navigation bar, select the region where the target function resides.

  3. On the Functions page, click the name of the target function.

  4. On the Function Details page, click the Logs tab, and then click Function Logs to view the execution logs.

Function logs showing a successfully received event from EventBridge

FAQ

How do I troubleshoot a failed event?

Open the EventBridge console, go to the Event Trace page, and locate the event in the Event Delivery section. The response details indicate what went wrong.

What does the "[500]ConnectErrorconnectiontimedout" error mean?

This error typically indicates a network connectivity issue between EventBridge and FC. To diagnose:

  1. Log on to the Function Compute console and run the target function manually. Note the execution duration.

  2. If execution takes longer than 15 seconds, check the network connection between the function and any downstream services.

  3. If execution completes in under 15 seconds, verify that the FC endpoint for the region is accessible.

  4. If the endpoint is unreachable, contact Function Compute support.