Event rules are used to monitor specific types of events. When an event that matches an event rule occurs, the event is routed to the targets associated with the rule. An event rule can be associated with one or more targets. This topic describes how to manage event rules in the EventBridge console, including operations such as creating, viewing, and deleting event rules.
Prerequisites
Create a rule
Log on to the EventBridge console.
In the left-side navigation pane, click Event Bus.
In the top navigation bar, select a region.
On the Event Bus page, click the name of the target event bus.
In the left-side navigation pane, click Event Rules.
On the Event Rules page, click Create Rule.
On the Create Rule page, perform the following steps:
In the Configure Basic Info step, enter a name for the rule in the Name text box and an optional description in the Description text box. Click Next Step.
In the Configure Event Pattern step, complete the configuration and click Next Step.
Click the Alibaba Cloud Service Event Sources tab.
Select an Alibaba Cloud service from the Event Sources list and an event type from the Event Type list.
NoteEvents from Alibaba Cloud services cannot be published to custom event buses. Consequently, you cannot select an event source from Alibaba Cloud Service Event Sources when your rule is on a custom event bus.
Click the Custom Event Source tab.
Select a custom event source from the Event Sources list and enter an event pattern in the Pattern Content code box.
For more information, see Event pattern.
In the Configure Targets step, configure one or more event targets, and then click Create.
ImportantYou can add up to five event targets to an event rule.
The target service and the event rule must be in the same region.
EventBridge supports the following event targets:
Function Compute: Processes events.
For more information, see What is Function Compute?.
ApsaraMQ for RocketMQ: Stores and routes events.
For more information, see What is ApsaraMQ for RocketMQ?.
ApsaraMQ for RabbitMQ: Stores and routes events.
For more information, see What is ApsaraMQ for RabbitMQ?.
Message Service (MNS): Stores events.
For more information, see What is Message Service (MNS)?.
EventBridge: Filters and transforms events.
For more information, see What is EventBridge?.
HTTP gateway: Processes business data in events.
HTTPS gateway: Processes business data in events.
Short Message Service: Sends event notifications by text message.
For more information, see What is Short Message Service?.
Direct Mail: Sends event notifications by email.
For more information, see What is Direct Mail?.
DingTalk: Sends event notifications to DingTalk.
For more information, see DingTalk Open Platform.
ApsaraDB RDS for MySQL: Stores and routes events.
For more information, see Overview of ApsaraDB RDS for MySQL.
self-managed MySQL database: Stores and routes events.
You can select an event transformation method as needed. For more information, see event transformation.
View a rule
On the Event Rules page, find the desired event rule and click Details in the Actions column.
The Rule Detail page shows the rule's basic information, event pattern, and event targets.
Disable a rule
On the Event Rules page, find the desired event rule and in the Actions column, choose .
In the Show prompt dialog box, read the message and click OK.
In the Verify Account Security dialog box, click Obtain Verification Code, enter the verification code you receive in the Verification Code text box, and click Confirm.
WarningDisabling an event rule may cause some of your services to become unavailable.
Enable a rule
On the Event Rules page, find the desired event rule and in the Actions column, choose .
In the Show prompt dialog box, read the message and click OK.
Edit event targets
On the Event Rules page, find the desired event rule and click Edit Targets in the Actions column.
On the Edit Rule page, modify the event target configurations and click Confirm.
Edit event pattern
On the Event Rules page, find the desired event rule and click Edit Pattern in the Actions column.
On the Edit Rule page, modify the Event Source and Pattern Content, and then click Confirm.
Delete a rule
On the Event Rules page, find the desired event rule and in the Actions column, choose .
In the Show prompt dialog box, read the message and click OK.
In the Verify Account Security dialog box, click Obtain Verification Code, enter the verification code you receive in the Verification Code text box, and click Confirm.
WarningA deleted event rule cannot be recovered.