All Products
Search
Document Center

EventBridge:Route events to Knative

Last Updated:Dec 23, 2024

You can use event rules to filter events and route the events to Knative. This topic describes the prerequisites and procedure for routing custom events to Knative. This topic also describes how to verify the result.

Before you start

Step 1: Create 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 targets that you want to configure for an event rule 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. In the Create Rule wizard, perform the following steps and click Create.

    1. In the Configure Basic Info step, configure the Name and Description parameters and click Next Step.

    2. In the Configure Event Pattern step, set the Event Source Type parameter to Custom Event Source, select the created event source from the Event Source drop-down list, and then click Next Step.

    3. In the Configure Targets step, configure the parameters and click Create.

      2cUNxQi1Fz

      Item

      Example

      Description

      Service Type

      Knative

      Select Knative from the drop-down list.

      Gateway

      alb-******

      Enter the gateway that you selected when you deployed the Knative Service.

      Host

      ******.example.com

      Enter the domain name that is associated when you deployed the Knative Service. The value can be the default domain name or a custom domain name.

      Body

      Complete Event

      Specify the method that you want to use to route events. The following routing methods are supported. For more information, see Event transformation.

      • Complete Event

      • Partial Event

      • Fixed Value

      • Template

      Maximum Concurrency

      22

      Specify the maximum number of concurrent requests.

      Network Type

      Internet

      Specify the network type. The following network types are supported:

Step 3: Publish an event

  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 custom event bus that you want to manage and click Publish Event in the Operations column.

    Note

    You can publish events only to custom event buses in the EventBridge console.

  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.

    Note
    • For information about the event parameters, see Overview.

    • After you click OK, the event ID is automatically copied.

Verify the result

  1. Go to the Overview page of the event bus that you want to manage.

  2. In the left-side navigation pane, click Event Tracking. Then, click the Query By Event ID tab.

  3. In the Event ID field, paste the event ID that is automatically copied and click Query.

  4. Click Event Trace in the Operations column of the queried event to view whether the event is delivered.

    NN4WLnSQ6Z