Customize email notifications for
scheduled events that affect Amazon EC2 instances
You can customize scheduled event notifications to include tags in the email
notification. This makes it easier to identify the affected resource (instances or
Dedicated Hosts) and to prioritize actions for the upcoming event.
When you customize event notifications to include tags, you can choose to
include:
For example, suppose that you assign application
,
costcenter
, project
, and owner
tags to
all of your instances. You can choose to include all of the tags in event
notifications. Alternatively, if you'd like to see only the owner
and
project
tags in event notifications, then you can choose to include
only those tags.
After you select the tags to include, the event notifications will include the
resource ID (instance ID or Dedicated Host ID) and the tag key and value pairs that are
associated with the affected resource.
The tags that you choose to include apply to all resources (instances and
Dedicated Hosts) in the selected Region. To customize event notifications in other
Regions, first select the required Region and then perform the following
steps.
You can include tags in event notifications by using one of the following
methods.
- Console
-
To include tags in event notifications
-
Open the Amazon EC2 console at
https://console.aws.amazon.com/ec2/.
-
In the navigation pane, choose
Events.
-
Choose Actions, Manage
event notifications.
-
Turn on Include tags in event notifications.
-
Do one of the following, depending on the tags that you
want to include in event notifications:
-
To include all tags associated with the affected
instance or Dedicated Host, select Include all
tags.
-
To select the tags to include, select
Choose the tags to include
and then select or enter the tag keys.
-
Choose Save.
- AWS CLI
-
To include all tags in event notifications
Use the register-instance-event-notification-attributes
AWS CLI command and set the IncludeAllTagsOfInstance
parameter to true
.
aws ec2 register-instance-event-notification-attributes \
--instance-tag-attribute "IncludeAllTagsOfInstance=true"
To include specific tags in event notifications
Use the register-instance-event-notification-attributes
AWS CLI command and specify the tags to include by using the
InstanceTagKeys
parameter.
aws ec2 register-instance-event-notification-attributes \
--instance-tag-attribute 'InstanceTagKeys=["tag_key_1
", "tag_key_2
", "tag_key_3
"]'
You can remove tags from event notifications by using one of the following
methods.
- Console
-
To remove tags from event notifications
-
Open the Amazon EC2 console at
https://console.aws.amazon.com/ec2/.
-
In the navigation pane, choose
Events.
-
Choose Actions, Manage
event notifications.
-
To remove all tags from event notifications, turn off
Include tags in event notifications.
-
To remove specific tags from event notifications,
choose the X) for the corresponding
tag keys.
-
Choose Save.
- AWS CLI
-
To remove all tags from event notifications
Use the deregister-instance-event-notification-attributes
AWS CLI command and set the IncludeAllTagsOfInstance
parameter to false
.
aws ec2 deregister-instance-event-notification-attributes \
--instance-tag-attribute "IncludeAllTagsOfInstance=false"
To remove specific tags from event notifications
Use the deregister-instance-event-notification-attributes
AWS CLI command and specify the tags to remove by using the
InstanceTagKeys
parameter.
aws ec2 deregister-instance-event-notification-attributes \
--instance-tag-attribute 'InstanceTagKeys=["tag_key_1
", "tag_key_2
", "tag_key_3
"]'
You can view the tags that are to be included in event notifications by using
one of the following methods.
- Console
-
- AWS CLI
-
To view the tags that are to be included in event
notifications
Use the describe-instance-event-notification-attributes
AWS CLI command.
aws ec2 describe-instance-event-notification-attributes