Creating a CloudWatch Events Rule That Triggers on an Event - Amazon CloudWatch Events
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Creating a CloudWatch Events Rule That Triggers on an Event


Amazon EventBridge is the preferred way to manage your events. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features. Changes you make in either CloudWatch or EventBridge will appear in each console. For more information, see Amazon EventBridge.

Use the following steps to create a CloudWatch Events rule that triggers on an event emitted by an Amazon service.

To create a rule that triggers on an event:
  1. Open the CloudWatch console at

  2. In the navigation pane, choose Events, Create rule.

  3. For Event source, do the following:

    1. Choose Event Pattern, Build event pattern to match events by service.

    2. For Service Name, choose the service that emits the event to trigger the rule.

    3. For Event Type, choose the specific event that is to trigger the rule. If the only option is Amazon API Call via CloudTrail, the selected service does not emit events and you can only base rules on API calls made to this service. For more information about creating this type of rule, see Creating a CloudWatch Events Rule That Triggers on an Amazon API Call Using Amazon CloudTrail.

    4. Depending on the service emitting the event, you may see options for Any... and Specific.... Choose Any... to have the event trigger on any type of the selected event, or choose Specific... to choose one or more specific event types.

  4. For Targets, choose Add Target and choose the Amazon service that is to act when an event of the selected type is detected.

  5. In the other fields in this section, enter information specific to this target type, if any is needed.

  6. For many target types, CloudWatch Events needs permissions to send events to the target. In these cases, CloudWatch Events can create the IAM role needed for your event to run:

    • To create an IAM role automatically, choose Create a new role for this specific resource.

    • To use an IAM role that you created before, choose Use existing role.

  7. Optionally, repeat steps 4-6 to add another target for this rule.

  8. Choose Configure details. For Rule definition, type a name and description for the rule.

    The rule name must be unique within this Region.

  9. Choose Create rule.