Configuring an EventBridge rule to send notifications about events in AWS Health
You can create an EventBridge rule to get notified for AWS Health events in your account. Before you create event rules for AWS Health, do the following:
-
Familiarize yourself with events, rules, and targets in EventBridge. For more information, see What is Amazon EventBridge? in the Amazon EventBridge User Guide and New EventBridge – Track and Respond to Changes to Your AWS Resources
. -
Create the target or targets to use in your event rules.
To create an EventBridge rule for AWS Health
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/
. -
To change the AWS Region, use the Region selector in the upper-right corner of the page. Choose the Region in which you want to track AWS Health events.
-
In the navigation pane, choose Rules.
-
Choose Create rule.
-
On the Define rule detail page, enter a name and description for your rule.
-
Keep the default values for Event bus and Rule type, and then choose Next.
-
On the Build event pattern page, for Event source, choose AWS events and EventBridge partner events.
-
Under Event pattern, for Event source, choose AWS services.
-
Under Event pattern, for AWS service, choose Health.
-
For Event type, choose one of the following options.
-
Specific Health Abuse Events – Create a rule for AWS Health events that have the word
Abuse
in the event type name. -
Specific Health events – Create a rule for events for a specific AWS service, such as Amazon EC2.
-
-
You can choose Any service or Specific service(s). If you chose a specific service, choose one of the following options:
-
Choose Any event type category to create a rule that applies to all event type categories.
-
Choose Specific event type category(s) and then choose a value from the list, such as issue, accountNotification, or scheduledChange.
Tip
-
To monitor all AWS Health events for a specific service, we recommend that you choose Any event type category and Any resource. This ensures that your rule monitors for any AWS Health events, including any new event type codes, for your specified service. For an example rule, see all Amazon EC2 events.
-
You can create a rule to monitor for more than one service or event type category. To do so, you must manually update the event pattern for the rule. For more information, see Creating a rule for multiple services and categories.
-
-
If you chose a specific service and event type category, choose one of the following options for event type codes.
-
Choose Any event type code to create a rule that applies to all event type codes.
-
Choose Specific event type code(s) and then choose one or more values from the list. This creates a rule that applies only to specific event type codes. For example, if you choose
AWS_EC2_INSTANCE_STOP_SCHEDULED
andAWS_EC2_INSTANCE_RETIREMENT_SCHEDULED
, your rule applies only to these events when they occur in your account.
-
-
Choose one of the following options for affected resources.
-
Choose Any resource to create a rule that applies to all resources.
-
Choose Specific resource(s) and enter the IDs of one or more resources. For example, you might specify an Amazon EC2 instance ID, such as
i-EXAMPLEa1b2c3de4
, to monitor for events that affect only this resource.
-
-
Review your rule setup so that it meets your event-monitoring requirements.
-
Choose Next.
-
On the Select target(s) page, choose the target type that you created for this rule, and then configure any additional options that are required for that type. For example, you might send the event to an Amazon SQS queue or an Amazon SNS topic.
-
Choose Next.
-
(Optional) On the Configure tags page, add any tags and then choose Next.
-
Note: Tags are currently not sent by the aws.health source in EventBridge.
-
-
On the Review and create page, review your rule setup and ensure that it meets your event monitoring requirements.
-
Choose Create rule.
Example : Rule for all Amazon EC2 events
The following example creates a rule so that EventBridge monitors for all Amazon EC2 events, including the event type categories, event codes, and resources.
Example : Rule for specific Amazon EC2 events
The following example creates a rule so that EventBridge monitors the following:
-
The Amazon EC2 service
-
The scheduledChange event type category
-
The event type codes for
AWS_EC2_INSTANCE_TERMINATION_SCHEDULED
andAWS_EC2_INSTANCE_RETIREMENT_SCHEDULED
-
The instance with the ID
i-EXAMPLEa1b2c3de4
Creating a rule for multiple services and categories
The examples in the previous procedure show you how to create a rule for a single service and event type category. You can also create a rule for multiple services and event type categories. This means that you don't have to create a separate rule for each service and category that you want to monitor. To do so, you must edit the event pattern and then enter your changes manually.
You can use one of the following options.
To add services and categories for an existing rule
-
In the EventBridge console, on the Rules page, choose the rule name.
-
In the upper-right corner, choose Edit.
-
Choose Next.
-
For Event pattern, choose Edit pattern, and then enter your changes into the text field.
-
Choose Next until you reach the Review and update page.
-
Choose Update rule to save your changes.
To add services and categories for a new rule
-
Follow the procedure in Configuring an EventBridge rule to send notifications about events in AWS Health to step 9.
-
Instead of choosing a single service or category from the lists, for Event pattern, choose Edit pattern.
-
Enter your changes into the text field. See the following example pattern as a model for creating your own event pattern.
-
Review your event pattern, and then follow the rest of the procedure in Configuring an EventBridge rule to send notifications about events in AWS Health to create your rule.
Use the API or AWS Command Line Interface (AWS CLI)
For a new or existing rule, use the PutRule API operation or the aws events put-rule
command to update
the event pattern. For an example AWS CLI command, see put-rule
in the AWS CLI Command Reference.
Example: Multiple services and event type categories
The following event pattern creates a rule to monitor events for the
issue
, accountNotification
, and scheduledChange
event type categories for three AWS services: Amazon EC2, Amazon EC2 Auto Scaling, and Amazon VPC.
{ "detail": { "eventTypeCategory": [ "issue", "accountNotification", "scheduledChange" ], "service": [ "AUTOSCALING", "VPC", "EC2" ] }, "detail-type": [ "AWS Health Event" ], "source": [ "aws.health" ] }