An event rule is used to monitor a specific type of events. If an event that matches an event rule occurs, the event is routed to an event target that is associated with the event rule. An event rule can be associated with one or more event targets. You can manage event rules in the EventBridge console. This topic describes how to perform management operations in the EventBridge console, including how to create, view, and delete event rules.

Prerequisites

Activate EventBridge and grant permissions to a RAM user

Create an event rule

  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, click the name of the target event bus.
  5. In the left-side navigation pane, click Event Rules.
  6. On the Event Rules page, click Create Rule.
  7. Perform the following operations in the Create Rule panel:
    1. In the Configure Basic Info step, enter a rule name in the Name field and a rule description in the Description field, and click Next Step.
    2. In the Configure Event Pattern step, set the parameters and click Next Step.
      • If you set the Event Source Type parameter to Alibaba Cloud Service Event Sources:

        Select an Alibaba Cloud service from the Event Source drop-down list and an event type from the Event Type drop-down list.

        Note Events from Alibaba Cloud services cannot be published to custom event buses. Therefore, you cannot set the Event Source Type parameter to Alibaba Cloud Service Event Source if the event bus that you use is a custom event bus.
      • If you set the Event Source Type parameter to Custom Event Source:

        Select a custom event source from the Event Source drop-down list and specify an event pattern in the Pattern Content code editor.

        For more information, see Event patterns.

    3. In the Configure Targets step, configure an event target and click Create.
      Important
      • You can configure up to five event targets for an event rule.
      • The event targets that you want to configure for an event rule must reside in the same region as the event rule.
      EventBridge supports the following event targets:

      You can select an event transformation method as needed. For more information, see Event transformation.

View the details of an event rule

On the Event Rules page, find the rule whose details you want to view and click Details in the Operations column.
On the Rule Detail page, you can view the basic information, event pattern, and event targets of the event rule.

Disable an event rule

  1. On the Event Rules page, find the rule that you want to disable and click Disable in the Operations column.
  2. In the Note message, read the note and click OK.
  3. In the Verify Account Security dialog box, click Obtain Verification Code, enter the verification code in the Verification Code field, and then click OK.
    Warning After you disable an event rule, specific services may be unavailable.

Enable an event rule

  1. On the Event Rules page, find the rule that you want to enable and click Enable in the Operations column.
  2. In the Note message, read the note and click OK.

Modify event targets

  1. On the Event Rules page, find the rule for which you want to modify the event targets and click Edit Targets in the Operations column.
  2. On the Edit Rule page, modify the settings of the event targets and click OK.

Modify an event pattern

  1. On the Event Rules page, find the rule for which you want to modify the event pattern and click Edit Pattern in the Operations column.
  2. On the Edit Rule page, modify the Event Source and Pattern Content parameters and click OK.

Delete an event rule

  1. On the Event Rules page, find the rule that you want to delete and click More > Delete in the Operations column.
  2. In the Note message, read the note and click OK.
  3. In the Verify Account Security dialog box, click Obtain Verification Code, enter the verification code in the Verification Code field, and then click OK.
    Warning After you delete an event rule, the data in the event rule cannot be restored.