Manage event rules

更新时间:
复制 MD 格式

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

Activate EventBridge and grant permissions

Create a rule

  1. Log on to the EventBridge console.

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

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

  4. On the Event Bus 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. On the Create Rule page, perform the following steps:

    1. 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.

    2. 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.

        Note

        Events 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.

    3. In the Configure Targets step, configure one or more event targets, and then click Create.

      Important
      • You 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:

      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

  1. On the Event Rules page, find the desired event rule and in the Actions column, choose More > Disable.

  2. In the Show prompt dialog box, read the message and click OK.

  3. 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.

    Warning

    Disabling an event rule may cause some of your services to become unavailable.

Enable a rule

  1. On the Event Rules page, find the desired event rule and in the Actions column, choose More > Enable.

  2. In the Show prompt dialog box, read the message and click OK.

Edit event targets

  1. On the Event Rules page, find the desired event rule and click Edit Targets in the Actions column.

  2. On the Edit Rule page, modify the event target configurations and click Confirm.

Edit event pattern

  1. On the Event Rules page, find the desired event rule and click Edit Pattern in the Actions column.

  2. On the Edit Rule page, modify the Event Source and Pattern Content, and then click Confirm.

Delete a rule

  1. On the Event Rules page, find the desired event rule and in the Actions column, choose More > Delete.

  2. In the Show prompt dialog box, read the message and click OK.

  3. 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.

    Warning

    A deleted event rule cannot be recovered.