Amazon EventBridge
User Guide

Tutorial: Log State Changes of Amazon EC2 Instances

In the example in this tutorial, you create a rule causing state-change notifications in Amazon EC2 to be logged in Amazon CloudWatch Logs.

To create a rule to log Amazon EC2 state-change notifications in CloudWatch Logs

  1. Open the Amazon EventBridge console at https://console.aws.amazon.com/events/.

  2. In the navigation pane, choose Rules.

  3. Choose Create rule.

  4. Enter a name and description for the rule.

  5. For Define pattern, do the following:

    1. Choose Event pattern.

    2. Choose Pre-defined pattern by service.

    3. For Service provider, choose AWS.

    4. For Service Name, choose EC2.

    5. For Event type, choose EC2 Instance State-change Notification.

    6. Choose Any state and Any instance.

  6. For Target, select CloudWatch log group.

  7. For Log group, enter a name for the log group to receive the state-change notifications.

  8. Choose Create.