Route events to MaxCompute
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
-
Create a table in your MaxCompute project. For details, see Table operations.
Step 1: Add a custom event source
Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.
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.
In the left-side navigation pane, click Event Sources and then click Add Event Source.
-
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
The event rule and the event target must be in the same region.
Log on to the EventBridge console. In the left-side navigation pane, click Event Buses.
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.
In the left-side navigation pane, click Event Rules. On the page that appears, click Create Rule.
-
On the Create Rule page:
-
In the Configure Basic Info step, enter a name in the Name field and a description in the Description field, and then click Next.
-
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.
-
In the Configure Targets step, configure the event target, and then click Create.
NoteYou 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
Log on to the EventBridge console.
In the left-side navigation pane, click Event Buses.
In the top navigation bar, select a region.
On the Event Buses page, find the target event bus and click Publish Event in the Operations column.
NoteThe EventBridge console supports publishing events to custom event buses only.
In the Publish Event To Custom Event Bus panel, configure the following settings:
Setting Description Custom Event Source Select an existing custom event source from the drop-down list. Event Body Enter the event content. Click OK.