Route events to MaxCompute

Updated at:

You can use an event rule to filter and route events to MaxCompute. This topic uses a custom event as an example to describe the prerequisites, procedure, and result verification.

Prerequisites

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, enter a Name and Description, set Event Provider to Custom Application, and then click Confirm.

Step 2: Create an event rule

Important

The event rule and the event target must be in the same region.

  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. On the Create Rule page:

    1. In the Configure Basic Info step, enter a name in the Name field and a description in the Description field, and then click Next.

    2. In the Configure Event Pattern step, set Event Source Type to Custom Event Source, for Event Source, select the custom event source that you created in Step 1, enter an event pattern in the Pattern Content code editor, and then click Next.

      For more information, see Event patterns.

    3. In the Configure Targets step, configure the event target, and then click Create.

      Note

      You can add up to five targets to an event rule.

      • Service Type: Select MaxCompute.

      • AccessKey ID: Select an existing AccessKey ID.

      • AccessKey Secret: Enter the AccessKey Secret.

      • MaxCompute Project Name: Enter your MaxCompute project name.

      • MaxCompute Table Name: Select your MaxCompute table name.

      • MaxCompute Table Input Parameter: Follow the console prompts to configure value extraction rules for the required parameters.

Step 3: Publish an event

  1. Log on to the EventBridge console.

  2. In the left-side navigation pane, click Event Buses.

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

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

    Note

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

  5. In the Publish Event To Custom Event Bus panel, configure the following settings:

    SettingDescription
    Custom Event SourceSelect an existing custom event source from the drop-down list.
    Event BodyEnter the event content.
  6. Click OK.

Verify the result