

# Monitor Amazon EC2 resources
Monitor resources

Monitoring is an important part of maintaining the reliability, availability, and performance of your Amazon EC2 instances and your AWS solutions. You should collect monitoring data from all of the parts in your AWS solutions so that you can more easily debug a multi-point failure if one occurs.

AWS provides various tools that you can use to monitor Amazon EC2. The Amazon EC2 and CloudWatch console dashboards provide an at-a-glance view of the state of your Amazon EC2 environment. In addition, we provide the following:
+ **System status checks** – Monitor the AWS systems required to use your instance to ensure that they are working properly. These checks detect problems with your instance that require AWS involvement to repair. When a system status check fails, you can choose to wait for AWS to fix the issue or you can resolve it yourself (for example, by stopping and restarting or terminating and replacing an instance). Examples of problems that cause system status checks to fail include:
  + Loss of network connectivity
  + Loss of system power
  + Software issues on the physical host
  + Hardware issues on the physical host that impact network reachability

  For more information, see [Status checks for Amazon EC2 instances](monitoring-system-instance-status-check.md).
+ **Instance status checks** – Monitor the software and network configuration of your individual instance. These checks detect problems that require your involvement to repair. When an instance status check fails, typically you will need to address the problem yourself (for example, by rebooting the instance or by making modifications in your operating system). Examples of problems that may cause instance status checks to fail include:
  + Failed system status checks
  + Misconfigured networking or startup configuration
  + Exhausted memory
  + Corrupted file system
  + Incompatible kernel

  For more information, see [Status checks for Amazon EC2 instances](monitoring-system-instance-status-check.md).
+ **Amazon CloudWatch alarms** – Watch a single metric over a time period you specify, and perform one or more actions based on the value of the metric relative to a given threshold over a number of time periods. The action is a notification sent to an Amazon Simple Notification Service (Amazon SNS) topic or Amazon EC2 Auto Scaling policy. Alarms invoke actions for sustained state changes only. CloudWatch alarms will not invoke actions simply because they are in a particular state; the state must have changed and been maintained for a specified number of periods. For more information, see [Monitor your instances using CloudWatch](using-cloudwatch.md).
+ **Amazon EventBridge events** – Automate your AWS services and respond automatically to system events. Events from AWS services are delivered to EventBridge in near real time, and you can specify automated actions to take when an event matches a rule you write. For more information, see [Automate Amazon EC2 using EventBridge](automating_with_eventbridge.md).
+ **AWS CloudTrail logs** – Capture detailed information about the calls made to the Amazon EC2 API and stores them as log files in Amazon S3. You can use CloudTrail logs to determine which calls were made, the source IP address for the call, who made the call, and when the call was made. For more information, see [Log Amazon EC2 API calls using AWS CloudTrail](monitor-with-cloudtrail.md).
+ **CloudWatch agent** – Collect logs and system-level metrics from both hosts and guests on your EC2 instances and on-premises servers. For more information, see [Collecting Metrics and Logs from Amazon EC2 Instances and On-Premises Servers with the CloudWatch Agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html) in the *Amazon CloudWatch User Guide*.

# Monitor the status of your Amazon EC2 instances
Monitor the status of your instances

You can monitor the status of your instances by viewing status checks and scheduled events for your instances.

A status check gives you the information that results from automated checks performed by Amazon EC2. These automated checks detect whether specific issues are affecting your instances. The status check information, together with the data provided by Amazon CloudWatch, gives you detailed operational visibility into each of your instances. 

You can also see the status of specific events that are scheduled for your instances. The status of events provides information about upcoming activities that are planned for your instances, such as rebooting or retirement. They also provide the scheduled start and end time of each event.

**Topics**
+ [

# Status checks for Amazon EC2 instances
](monitoring-system-instance-status-check.md)
+ [

# State change events for Amazon EC2 instances
](monitoring-instance-state-changes.md)
+ [

# Scheduled events for Amazon EC2 instances
](monitoring-instances-status-check_sched.md)

# Status checks for Amazon EC2 instances
Status checks

With instance status monitoring, you can quickly determine whether Amazon EC2 has detected any problems that might prevent your instances from running applications. Amazon EC2 performs automated checks on every running EC2 instance to identify hardware and software issues. You can view the results of these status checks to identify specific and detectable problems. The event status data augments the information that Amazon EC2 already provides about the state of each instance (such as `pending`, `running`, `stopping`) and the utilization metrics that Amazon CloudWatch monitors (CPU utilization, network traffic, and disk activity).

Status checks are performed every minute, returning a pass or a fail status. If all checks pass, the overall status of the instance is **OK**. If one or more checks fail, the overall status is **impaired**. Status checks are built into Amazon EC2, so they cannot be disabled or deleted.

When a status check fails, the corresponding CloudWatch metric for status checks is incremented. For more information, see [Status check metrics](viewing_metrics_with_cloudwatch.md#status-check-metrics). You can use these metrics to create CloudWatch alarms that are triggered based on the result of the status checks. For example, you can create an alarm to warn you if status checks fail on a specific instance. For more information, see [Create CloudWatch alarms for Amazon EC2 instances that fail status checks](creating_status_check_alarms.md).

You can also create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance and automatically recovers the instance if it becomes impaired due to an underlying issue. For more information, see [Automatic instance recovery](ec2-instance-recover.md).

**Topics**
+ [

## Types of status checks
](#types-of-instance-status-checks)
+ [

# View status checks for Amazon EC2 instances
](viewing_status.md)
+ [

# Create CloudWatch alarms for Amazon EC2 instances that fail status checks
](creating_status_check_alarms.md)

## Types of status checks


There are three types of status checks.
+ [System status checks](#system-status-checks)
+ [Instance status checks](#instance-status-checks)
+ [Attached EBS status checks](#attached-ebs-status-checks)

### System status checks


System status checks monitor the AWS systems on which your instance runs. These checks detect underlying problems with your instance that require AWS involvement to repair. When a system status check fails, you can choose to wait for AWS to fix the issue, or you can resolve it yourself. For instances backed by Amazon EBS, you can stop and start the instance yourself, which in most cases results in the instance being migrated to a new host. For instances backed by instance store (supported only for Linux instances), you can terminate and replace the instance. Note that instance store volumes are ephemeral and all data is lost when the instance is stopped.

The following are examples of problems that can cause system status checks to fail:
+ Loss of network connectivity
+ Loss of system power
+ Software issues on the physical host
+ Hardware issues on the physical host that impact network reachability

If a system status check fails, we increment the [StatusCheckFailed\$1System](viewing_metrics_with_cloudwatch.md#status-check-metrics) metric.

**Bare metal instances**  
If you perform a restart from the operating system on a bare metal instance, the system status check might temporarily return a fail status. When the instance becomes available, the system status check should return a pass status.

### Instance status checks


Instance status checks monitor the software and network connectivity of your individual instance. Amazon EC2 checks the health of the instance by sending an address resolution protocol (ARP) request to the network interface (NIC). These checks detect problems that require your involvement to repair. When an instance status check fails, you typically must address the problem yourself (for example, by rebooting the instance or by making instance configuration changes).

**Note**  
Recent Linux distributions that use `systemd-networkd` for network configuration might report on health checks differently from earlier distributions. During the boot process, this type of network can start earlier and potentially finish before other startup tasks that can also affect instance health. Status checks that depend on network availability can report a healthy status before other tasks complete.

The following are examples of problems that can cause instance status checks to fail:
+ Failed system status checks
+ Incorrect networking or startup configuration
+ Exhausted memory
+ Corrupted file system
+ Incompatible kernel
+ During a reboot, an instance status check reports a failure until the instance becomes available again.

If an instance status check fails, we increment the [StatusCheckFailed\$1Instance](viewing_metrics_with_cloudwatch.md#status-check-metrics) metric.

**Bare metal instances**  
If you perform a restart from the operating system on a bare metal instance, the instance status check might temporarily return a fail status. When the instance becomes available, the instance status check should return a pass status.

### Attached EBS status checks


Attached EBS status checks monitor if the Amazon EBS volumes attached to an instance are reachable and able to complete I/O operations. The `StatusCheckFailed_AttachedEBS` metric is a binary value that indicates impairment if one or more of the EBS volumes attached to the instance are unable to complete I/O operations. These status checks detect underlying issues with the compute or Amazon EBS infrastructure. When the attached EBS status check metric fails, you can either wait for AWS to resolve the issue, or you can take actions, such as replacing the affected volumes or stopping and restarting the instance.

The following are examples of issues that can cause attached EBS status checks to fail:
+ Hardware or software issues on the storage subsystems underlying the EBS volumes
+ Hardware issues on the physical host that impact reachability of the EBS volumes
+ Connectivity issues between the instance and EBS volumes

You can use the `StatusCheckFailed_AttachedEBS` metric to help improve the resilience of your workload. You can use this metric to create Amazon CloudWatch alarms that are triggered based on the result of the status check. For example, you could fail over to a secondary instance or Availability Zone when you detect a prolonged impact. Alternatively, you can monitor the I/O performance of each attached volume using EBS CloudWatch metrics to detect and replace the impaired volume. If your workload is not driving I/O to any EBS volumes attached to your instance, and the EBS status check indicates an impairment, you can stop and start the instance to move it to a new host. This can resolve underlying host issues that are impacting the reachability of the EBS volumes. For more information, see [Amazon CloudWatch metrics for Amazon EBS](https://docs.aws.amazon.com/ebs/latest/userguide/using_cloudwatch_ebs.html).

You can also configure your Amazon EC2 Auto Scaling groups to detect attached EBS status check failures, and then replace the affected instance with a new one. For more information, see [ Monitor and replace Auto Scaling instances with impaired Amazon EBS volumes](https://docs.aws.amazon.com/autoscaling/ec2/userguide/monitor-and-replace-instances-with-impaired-ebs-volumes.html) in the *Amazon EC2 Auto Scaling User Guide*.

**Note**  
The attached EBS status check metric is available only for Nitro instances.

# View status checks for Amazon EC2 instances
View status checks

If your instance has a failed status check, you typically must address the problem yourself (for example, by rebooting the instance or by making instance configuration changes). To troubleshoot system or instance status check failures yourself, see [Troubleshoot Amazon EC2 Linux instances with failed status checks](TroubleshootingInstances.md).

------
#### [ Console ]

**To view status checks**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. On the **Instances** page, the **Status check** column lists the operational status of each instance.

1. To view the status of a specific instance, select the instance, and then choose the **Status and alarms** tab.

1. To review the CloudWatch metrics for status checks, on the **Status and alarms** tab, expand **Metrics** to see the graphs for the following metrics:
   + **Status check failed for system**
   + **Status check failed for instance**
   + **Status check failed for attached EBS**

   For more information, see [Status check metrics](viewing_metrics_with_cloudwatch.md#status-check-metrics).

------
#### [ AWS CLI ]

**To view status checks**  
Use the [describe-instance-status](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-status.html) command.

**Example**: Get the status of all running instances

```
aws ec2 describe-instance-status
```

**Example**: Get the status of all instances

```
aws ec2 describe-instance-status --include-all-instances
```

**Example**: Get the status of a single running instance

```
aws ec2 describe-instance-status --instance-ids i-1234567890abcdef0
```

**Example**: Get all instances with a status of `impaired`

```
aws ec2 describe-instance-status \
--filters Name=instance-status.status,Values=impaired
```

------
#### [ PowerShell ]

**To view status checks**  
Use the [Get-EC2InstanceStatus](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceStatus.html) command.

**Example**: Get the status of all running instances

```
Get-EC2InstanceStatus
```

**Example**: Get the status of all instances

```
Get-EC2InstanceStatus -IncludeAllInstance $true
```

**Example**: Get the status of a single running instance

```
Get-EC2InstanceStatus -InstanceId i-1234567890abcdef0
```

**Example**: Get all instances with a status of `impaired`

```
Get-EC2InstanceStatus \
-Filter @{Name="instance-status.status"; Values="impaired"}
```

------

# Create CloudWatch alarms for Amazon EC2 instances that fail status checks
Create status check alarms

You can use the [status check metrics](viewing_metrics_with_cloudwatch.md#status-check-metrics) to create CloudWatch alarms to notify you when an instance has a failed status check.

Status checks and status check alarms can temporarily enter an *insufficient data* state if there are missing metric data points. Although rare, this can happen when there is an interruption in the metric reporting systems, even when an instance is healthy. We recommend that you treat this state as missing data instead of a status check failure or alarm breach. This is especially important when taking stop, terminate, reboot, or recover actions on the instance in response.

------
#### [ Console ]

This example configures an alarm that sends a notification when an instance fails a status check. You can optionally stop, terminate, or recover the instance.

**To create a status check alarm**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance, choose the **Status Checks** tab, and choose **Actions**, **Create status check alarm**.

1. On the **Manage CloudWatch alarms** page, under **Add or edit alarm**, choose **Create an alarm**.

1. For **Alarm notification**, turn the toggle on to configure Amazon Simple Notification Service (Amazon SNS) notifications. Select an existing Amazon SNS topic or enter a name to create a new topic.

   If you add an email address to the list of recipients or create a new topic, Amazon SNS sends a confirmation email to each new address. Each recipient must choose the confirmation link in the email. Only confirmed addresses receive alert notifications.

1. For **Alarm action**, turn the toggle on to specify an action to take when the alarm is triggered. Select the action.

1. For **Alarm thresholds**, specify the metric and criteria for the alarm.

   You can leave the default settings for **Group samples by** (**Average**) and **Type of data to sample** (**Status check failed:either**), or you can change them to suit your needs.

   For **Consecutive period**, set the number of periods to evaluate and, in **Period**, enter the evaluation period duration before triggering the alarm and sending an email.

1. (Optional) For **Sample metric data**, choose **Add to dashboard**.

1. Choose **Create**.

If you need to change an instance status alarm, you can edit it.

**To edit a status check alarm**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance and choose **Actions**, **Monitoring**, **Manage CloudWatch alarms**.

1. On the **Manage CloudWatch alarms** page, under **Add or edit alarm**, choose **Edit an alarm**.

1. For **Search for alarm**, choose the alarm.

1. When you are finished making changes, choose **Update**.

------
#### [ AWS CLI ]

In the following example, the alarm publishes a notification to an SNS topic when the instance fails either the instance check or system status check for at least two consecutive periods. The CloudWatch metric used is `StatusCheckFailed`.

**To create a status check alarm**

1. Select an existing SNS topic or create a new one. For more information, see [Accessing Amazon SNS in the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-services-sns.html) in the *AWS Command Line Interface User Guide*.

1. Use the following [list-metrics](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/list-metrics.html) command to view the available Amazon CloudWatch metrics for Amazon EC2.

   ```
   aws cloudwatch list-metrics --namespace AWS/EC2
   ```

1. Use the following [put-metric-alarm](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/put-metric-alarm.html) command to create the alarm.

   ```
   aws cloudwatch put-metric-alarm \
       --alarm-name StatusCheckFailed-Alarm-for-i-1234567890abcdef0 \
       --metric-name StatusCheckFailed \
       --namespace AWS/EC2 \
       --statistic Maximum \
       --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
       --unit Count \
       --period 300 \
       --evaluation-periods 2 \
       --threshold 1 \
       --comparison-operator GreaterThanOrEqualToThreshold \
       --alarm-actions arn:aws:sns:us-west-2:111122223333:my-sns-topic
   ```

   The period is the time frame, in seconds, in which Amazon CloudWatch metrics are collected. This example uses 300, which is 60 seconds multiplied by 5 minutes. The evaluation period is the number of consecutive periods for which the value of the metric must be compared to the threshold. This example uses 2. The alarm actions are the actions to perform when this alarm is triggered.

------
#### [ PowerShell ]

**To create a status check alarm**  
Use the [Write-CWMetricAlarm](https://docs.aws.amazon.com/powershell/latest/reference/items/Write-CWMetricAlarm.html) cmdlet as follows to publish notifications to an SNS topic when the instance fails status checks for at least two consecutive periods.

```
Write-CWMetricAlarm `
    -AlarmName "StatusCheckFailed-Alarm-for-i-1234567890abcdef0" `
    -MetricName "StatusCheckFailed" `
    -Namespace "AWS/EC2" `
    -Statistic "Maximum" `
    -Dimension @{Name="InstanceId"; Values="i-1234567890abcdef0"} `
    -Unit "Count" `
    -Period 300 `
    -EvaluationPeriod 2 `
    -Threshold 1 `
    -ComparisonOperator "GreaterThanOrEqualToThreshold" `
    -AlarmAction "arn:aws:sns:us-west-2:111122223333:my-sns-topic"
```

The period is the time frame, in seconds, in which Amazon CloudWatch metrics are collected. This example uses 300, which is 60 seconds multiplied by 5 minutes. The evaluation period is the number of consecutive periods for which the value of the metric must be compared to the threshold. This example uses 2. The alarm actions are the actions to perform when this alarm is triggered.

------

# State change events for Amazon EC2 instances
State change events

Amazon EC2 sends an `EC2 Instance State-change Notification` event to Amazon EventBridge when the state of an instance changes.

The following is example data for this event. In this example, the instance entered the `pending` state.

```
{
   "id":"7bf73129-1428-4cd3-a780-95db273d1602",
   "detail-type":"EC2 Instance State-change Notification",
   "source":"aws.ec2",
   "account":"123456789012",
   "time":"2021-11-11T21:29:54Z",
   "region":"us-east-1",
   "resources":[
      "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
   ],
   "detail":{
      "instance-id":"i-1234567890abcdef0",
      "state":"pending"
   }
}
```

The possible values for `state` are:
+ `pending`
+ `running`
+ `stopping`
+ `stopped`
+ `shutting-down`
+ `terminated`

When you launch or start an instance, it enters the `pending` state and then the `running` state. When you stop an instance, it enters the `stopping` state and then the `stopped` state. When you terminate an instance, it enters the `shutting-down` state and then the `terminated` state. For more information, see [Amazon EC2 instance state changes](ec2-instance-lifecycle.md).

# Create an alarm that sends an email when an Amazon EC2 instance changes state
Create alarm for instance state changes

To receive email notifications when your instance changes state, create an Amazon SNS topic and then create an EventBridge rule for the `EC2 Instance State-change Notification` event.

**To create an SNS topic**

1. Open the Amazon SNS console at [https://console.aws.amazon.com/sns/v3/home](https://console.aws.amazon.com/sns/v3/home).

1. In the navigation pane, choose **Topics**.

1. Choose **Create topic**.

1. For **Type**, choose **Standard**.

1. For **Name**, enter a name for your topic.

1. Choose **Create topic**.

1. Choose **Create subscription**.

1. For **Protocol**, choose **Email**.

1. For **Endpoint**, enter the email address that receives the notifications.

1. Choose **Create subscription**.

1. You'll receive an email message with the following subject line: AWS Notification - Subscription Confirmation. Follow the directions to confirm your subscription.

**To create an EventBridge rule**

1. Open the Amazon EventBridge console at [https://console.aws.amazon.com/events/](https://console.aws.amazon.com/events/).

1. Choose **Create rule**.

1. For **Name**, enter a name for your rule.

1. For **Rule type**, choose **Rule with an event pattern**.

1. Choose **Next**.

1. For **Event pattern**, do the following:

   1. For **Event source**, choose **AWS services**.

   1. For **AWS service**, choose **EC2**.

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

   1. By default, we send notifications for any state change for any instance. If you prefer, you can select specific states or specific instances.

1. Choose **Next**.

1. Specify a target as follows:

   1. For **Target types**, choose **AWS service**.

   1. For **Select a target**, choose **SNS topic**.

   1. For **Topic**, choose the SNS topic that you created in the previous procedure.

1. Choose **Next**.

1. (Optional) Add tags to your rule.

1. Choose **Next**.

1. Choose **Create rule**.

1. To test your rule, initiate a state change. For example, start a stopped instance, stop a running instance, or launch an instance. You'll receive email messages with the following subject line: AWS Notification Message. The body of the email contains the event data.

# Scheduled events for Amazon EC2 instances
Scheduled events

To ensure infrastructure reliability and performance, AWS can schedule events to reboot, stop, and retire your instances. These events do not occur frequently.

If one of your instances will be affected by a scheduled event, AWS notifies you in advance by email, using the email address that's associated with your AWS account. The email provides details about the event, such as the start and end dates. Depending on the event type, you might be able to take action to control the timing of the event. AWS also sends an AWS Health event, which you can monitor and manage by using Amazon EventBridge. For more information, see [Monitoring events in AWS Health with Amazon EventBridge](https://docs.aws.amazon.com/health/latest/ug/cloudwatch-events-health.html). 

Scheduled events are managed by AWS. You can't schedule events for your instances. However, you can:
+ View scheduled events for your instances.
+ Customize scheduled event notifications to include or remove tags from the email notification.
+ Reschedule certain scheduled events.
+ Create custom event windows for scheduled events.
+ Take action when an instance is scheduled to reboot, stop, or retire.

To ensure that you receive notifications of scheduled events, verify your contact information on the [Account](https://console.aws.amazon.com/billing/home?#/account) page.

**Note**  
When an instance is affected by a scheduled event, and it is part of an Auto Scaling group, Amazon EC2 Auto Scaling eventually replaces it as part of its health checks, with no further action necessary on your part. For more information about the health checks performed by Amazon EC2 Auto Scaling, see [Health checks for instances in an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-health-checks.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Types of scheduled events


Amazon EC2 can create the following types of scheduled events for your instances, where the event occurs at a scheduled time:


| Event type | Event code | Event action | 
| --- | --- | --- | 
| Instance stop | instance-stop | At the scheduled time, the instance is stopped. When you start it again, it's migrated to a new host. Applies only to instances with an Amazon EBS root volume. | 
| Instance retirement | instance-retirement | At the scheduled time, the instance is stopped if it has an Amazon EBS root volume, or terminated if it has an instance store root volume. | 
| Instance reboot | instance-reboot | At the scheduled time, the instance is rebooted. The instance stays on the host, and during the reboot, the host undergoes maintenance. This is known as an in-place reboot. | 
| System reboot | system-reboot | At the scheduled time, the instance is rebooted and migrated to a new host. This is known as a reboot migration. | 
| System maintenance | system-maintenance | At the scheduled time, the instance might be temporarily affected by network maintenance or power maintenance. | 

## Determine the event type


You can check what type of event is scheduled for your instance.

------
#### [ Console ]

**To determine the event type**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. In the table, the event code appears in the **Event type** column.

1. To filter the table to show only the events for instances, in the search field choose **Resource type: instance** from the filter list.

------
#### [ AWS CLI ]

**To determine the event type for an instance**  
Use the [describe-instance-status](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-status.html) command. If the instance has an associated scheduled event, the output provides information about the scheduled event.

```
aws ec2 describe-instance-status \
    --instance-id i-1234567890abcdef0 \
    --query InstanceStatuses[].Events
```

The following is example output. The scheduled event code is `system-reboot`.

```
[
    "Events": [
        {
            "InstanceEventId": "instance-event-0d59937288b749b32",
            "Code": "system-reboot",
            "Description": "The instance is scheduled for a reboot",
            "NotAfter": "2020-03-14T22:00:00.000Z",
            "NotBefore": "2020-03-14T20:00:00.000Z",
            "NotBeforeDeadline": "2020-04-05T11:00:00.000Z"
        }
    ]
]
```

------
#### [ PowerShell ]

**To determine the event type for an instance**  
Use the [Get-EC2InstanceStatus](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceStatus.html) cmdlet. If the instance has an associated scheduled event, the output provides information about the scheduled event.

```
(Get-EC2InstanceStatus `
    -InstanceId i-1234567890abcdef0).Events
```

The following is example output. The scheduled event code is `system-reboot`.

```
Code              : system-reboot
Description       : The instance is scheduled for a reboot
InstanceEventId   : instance-event-0d59937288b749b32
NotAfter          : 2020-03-14T22:00:00.000Z
NotBefore         : 2020-03-14T20:00:00.000Z
NotBeforeDeadline : 2020-04-05T11:00:00.000Z
```

------

**Topics**
+ [

## Types of scheduled events
](#types-of-scheduled-events)
+ [

## Determine the event type
](#scheduled-event-type)
+ [

# Manage Amazon EC2 instances scheduled to stop or retire
](schedevents_actions_retire.md)
+ [

# Manage Amazon EC2 instances scheduled for reboot
](schedevents_actions_reboot.md)
+ [

# Manage Amazon EC2 instances scheduled for maintenance
](schedevents_actions_maintenance.md)
+ [

# View scheduled events that affect your Amazon EC2 instances
](viewing_scheduled_events.md)
+ [

# Customize scheduled event notifications for your EC2 instances
](customizing_scheduled_event_notifications.md)
+ [

# Reschedule a scheduled event for an EC2 instance
](reschedule-event.md)
+ [

# Create custom event windows for scheduled events that affect your Amazon EC2 instances
](event-windows.md)

# Manage Amazon EC2 instances scheduled to stop or retire
Manage instances scheduled to stop or retire

When AWS detects irreparable failure of the underlying host for your instance, it schedules the instance to either stop or terminate, depending on the instance's root volume type.
+ If the instance has an Amazon EBS root volume, the instance is scheduled to stop.
+ If the instance has an instance store root volume, the instance is scheduled to terminate.

For more information, see [Instance retirement](instance-retirement.md).

**Important**  
Any data stored on instance store volumes is lost when an instance is stopped, hibernated, or terminated. This includes instance store volumes that are attached to an instance that has an EBS root volume. Be sure to save data from your instance store volumes that you might need later before the instance is stopped, hibernated, or terminated.

## Actions you can take


**Actions you can take for instances with an EBS root volume**

When you receive a scheduled `instance-stop` event notification, you can take one of the following actions:
+ **Wait for scheduled stop:** You can wait for the instance to stop within its scheduled maintenance window.
+ **Perform manual stop and start:** You can stop and start the instance yourself at a time that suits you, which migrates it to a new host. This is not the same as rebooting the instance. For more information, see [Stop and start Amazon EC2 instances](Stop_Start.md).
+ **Automate stop and start:** You can automate an immediate stop and start in response to a scheduled `instance-stop` event. For more information, see [Running operations on EC2 instances automatically in response to events in AWS Health](https://docs.aws.amazon.com/health/latest/ug/automating-instance-actions.html) in the *AWS Health User Guide*.

**Actions you can take for instances with an instance store root volume**

When you receive a scheduled `system-retirement` event notification, and you want to retain your data, you can take the following actions:

1. Launch a replacement instance from your most recent AMI.

1. Migrate all necessary data to the replacement instance before the instance is scheduled to terminate.

1. Terminate the original instance, or wait for it to terminate as scheduled.

For more information about the actions you can take, see [Instance retirement](instance-retirement.md).

# Manage Amazon EC2 instances scheduled for reboot
Manage instances scheduled for reboot

When AWS must perform tasks such as installing updates or maintaining the underlying host, it can schedule an instance reboot. During the scheduled reboot, the instance either stays on the same host, or migrates to a different host, depending on the event, as follows:
+ `instance-reboot` event
  + During the reboot, the instance remains on the host. This is known as an *in-place reboot*.
  + The current host undergoes maintenance. 
  + Typically completes in seconds.
+ `system-reboot` event
  + During the reboot, the instance is migrated to a new host. This is known as a *reboot migration*.
  + Typically completes in minutes.

To check what type of event is scheduled for your instance, see [Determine the event type](monitoring-instances-status-check_sched.md#scheduled-event-type).

## Actions you can take


When you receive a scheduled `instance-reboot` or `system-reboot` event notification, you can take one of the following actions:
+ **Wait for scheduled reboot:** You can wait for the instance reboot to occur within its scheduled maintenance window.
+ **Reschedule the reboot:** You can [reschedule](reschedule-event.md) the instance reboot to a date and time that suits you.
+ **Perform a user-initiated reboot:** You can manually [reboot](ec2-instance-reboot.md) the instance yourself at a time that suits you. However, the outcome depends on the event:
  + `instance-reboot` event – Your instance remains on the current hardware (in-place reboot), no host maintenance takes place, and the event stays open.
  + `system-reboot` event
    + If reboot migration is enabled on your instance, a user-initiated reboot attempts to migrate your instance to new hardware. If successful, the event is cleared. If unsuccessful, an in-place reboot occurs and the event remains scheduled.
    + If reboot migration is disabled on your instance, a user-initiated reboot keeps the instance on the same hardware (in-place reboot), no host maintenance takes place, and the event remains scheduled. When the scheduled event eventually takes place, AWS will move your instance to new hardware (reboot migration).

**After AWS reboots your instance**

The following applies after AWS reboots your instance:
+ The scheduled event is cleared.
+ The event description is updated.
+ For an `instance-reboot` event:
  + Maintenance of the underlying host is complete.
+ For a `system-reboot` event:
  + The instance moves to a new host.
  + The instance retains its IP address and DNS name.
  + Any data on local instance store volumes is preserved.
+ You can use your instance after it has fully booted.

**Alternative options**

If you can't reschedule the reboot event or enable reboot migration for a user-initiated reboot, but want to maintain normal operation during the scheduled maintenance window, you can do the following:
+ **For an instance with an EBS root volume**
  + Manually stop and start the instance to migrate it to a new host. This is not the same as manually rebooting the instance, where the instance stays on the same host.
  + Optionally, automate an immediate instance stop and start in response to the scheduled reboot event. For more information, see [Running operations on EC2 instances automatically in response to events in AWS Health](https://docs.aws.amazon.com/health/latest/ug/automating-instance-actions.html) in the *AWS Health User Guide*.
**Important**  
The data on instance store volumes is lost when an instance is stopped. For more information, see [Stop and start Amazon EC2 instances](Stop_Start.md).
+ **For an instance with an instance store root volume**

  1. Launch a replacement instance from your most recent AMI.

  1. Migrate all necessary data to the replacement instance before the scheduled maintenance window.

  1. Terminate the original instance.

## Enable or disable reboot migration


When an instance is scheduled for a `system-reboot` event, you can reboot it before the event. The outcome of a user-initiated reboot depends on the instance's reboot migration setting:
+ Enabled – A user-initiated reboot attempts to migrate your instance to new hardware (reboot migration). If successful, the event is cleared. If unsuccessful, an in-place reboot occurs and the event remains scheduled. Note that even when enabled, reboot migration can only occur if your instance meets the [reboot migration requirements](#requirements-for-reboot-migration).
+ Disabled – A user-initiated reboot keeps the instance on the same hardware (in-place reboot), no host maintenance takes place, and the event remains scheduled. When the scheduled event eventually takes place, AWS will move your instance to new hardware (reboot migration).

A reboot with migration takes longer than an in-place reboot:
+ In-place reboot: Approximately 30 seconds
+ Reboot with migration: Several minutes

**Note**  
Instances that receive a `system-reboot` event notification are enabled for user-initiated reboot migration by default.

### Requirements for enabling reboot migration


Reboot migration can be enabled on instances that meet the following criteria:

**Instance types**  
Not all instance types support enabling reboot migration. You can view the instance types that support enabling reboot migration.  

**To view the instance types that support enabling reboot migration**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the left navigation pane, choose **Instance Types**.

1. In the filter bar, enter **Reboot Migration support: supported**. As you enter the characters and the filter name appears, you can select it.

   The **Instance types** table displays all the instance types that support enabling reboot migration.
**To view the instance types that support enabling reboot migration**  
Use the [describe-instance-types](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-types.html) command with the `reboot-migration-support` filter.

```
aws ec2 describe-instance-types \
    --filters Name=reboot-migration-support,Values=supported \
    --query "InstanceTypes[*].[InstanceType]" \
    --output text | sort
```
**To view the instance types that support enabling reboot migration**  
Use the [Get-EC2InstanceType](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceType.html) cmdlet with the `reboot-migration-support` filter.

```
Get-EC2InstanceType `
    -Filter @{Name="reboot-migration-support";Values="true"} | `
    Select InstanceType | Sort-Object InstanceType
```

**Tenancy**  
+ Shared
+ Dedicated Instance
For more information, see [Amazon EC2 Dedicated Instances](dedicated-instance.md).

**Limitations**

Reboot migration is **not** supported for instances with the following characteristics:
+ Platform: Instances running natively on the Xen hypervisor
+ Instance size: `metal` instances
+ Tenancy: Dedicated Host. For Dedicated Hosts, use [Dedicated Host Auto Recovery](dedicated-hosts-recovery.md) instead.
+ Storage: Instances with instance store volumes
+ Networking: Instances using an Elastic Fabric Adapter
+ Auto Scaling: Instances that are part of an Auto Scaling group

### Steps for enabling or disabling reboot migration


When an instance receives a `system-reboot` event, it is enabled for reboot migration by default. You can disable reboot migration so that during a user-initiated reboot, the instance stays on the same hardware (in-place reboot).

The `default` configuration doesn't enable reboot migration for an unsupported instance. For more information, see [Requirements for enabling reboot migration](#requirements-for-reboot-migration).

You can disable or enable reboot migration on a running or stopped instance.

------
#### [ AWS CLI ]

**To disable reboot migration**  
Use the [modify-instance-maintenance-options](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-maintenance-options.html) command and set the `--reboot-migration` parameter to `disabled`.

```
aws ec2 modify-instance-maintenance-options \ 
    --instance-id i-0abcdef1234567890 \ 
    --reboot-migration disabled
```

**To enable reboot migration**  
Use the [modify-instance-maintenance-options](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-maintenance-options.html) command and set the `--reboot-migration` parameter to `default`.

```
aws ec2 modify-instance-maintenance-options \ 
    --instance-id i-0abcdef1234567890 \ 
    --reboot-migration default
```

------
#### [ PowerShell ]

**To disable reboot migration**  
Use the [Edit-EC2InstanceMaintenanceOption](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceMaintenanceOption.html) cmdlet.

```
Edit-EC2InstanceMaintenanceOption `
    -InstanceId  `
    -RebootMigration Disabled
```

**To enable reboot migration**  
Use the [Edit-EC2InstanceMaintenanceOption](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceMaintenanceOption.html) cmdlet.

```
Edit-EC2InstanceMaintenanceOption `
    -InstanceId i-1234567890abcdef0 `
    -RebootMigration Enabled
```

------

# Manage Amazon EC2 instances scheduled for maintenance
Manage instances scheduled for maintenance

When AWS must maintain the underlying host for an instance, it schedules the instance for maintenance. There are two types of maintenance events: network maintenance and power maintenance.
+ During network maintenance, scheduled instances lose network connectivity for a brief period of time. Normal network connectivity to your instance is restored after maintenance is complete.
+ During power maintenance, scheduled instances are taken offline for a brief period, and then rebooted. When a reboot is performed, all of your instance's configuration settings are retained.

After your instance has rebooted (this normally takes a few minutes), verify that your application is working as expected. At this point, your instance should no longer have a scheduled event associated with it, or if it does, the description of the scheduled event begins with **[Completed]**. It sometimes takes up to 1 hour for the instance status description to refresh. Completed maintenance events are displayed on the Amazon EC2 console dashboard for up to a week.

## Actions you can take


**Actions you can take for instances with an EBS root volume**

When you receive a `system-maintenance` event notification, you can take one of the following actions:
+ **Wait for scheduled maintenance:** You can wait for the maintenance to occur as scheduled.
+ **Perform manual stop and stop:** You can stop and start the instance, which migrates it to a new host. This is not the same as rebooting the instance. For more information, see [Stop and start Amazon EC2 instances](Stop_Start.md).
+ **Automate stop and start:** You can automate an immediate stop and start in response to a scheduled maintenance event. For more information, see [Running operations on EC2 instances automatically in response to events in AWS Health](https://docs.aws.amazon.com/health/latest/ug/automating-instance-actions.html) in the *AWS Health User Guide*.

**Actions you can take for instances with an instance store root volume**

When you receive a `system-maintenance` event notification, you can take one of the following actions:
+ **Wait for scheduled maintenance:** You can wait for the maintenance to occur as scheduled.
+ **Launch a replacement instance:** If you want to maintain normal operation during the scheduled maintenance window:

  1. Launch a replacement instance from your most recent AMI.

  1. Migrate all necessary data to the replacement instance before the scheduled maintenance window.

  1. Terminate the original instance.

# View scheduled events that affect your Amazon EC2 instances
View scheduled events

In addition to receiving notification of scheduled events in email, you can check for scheduled events.

------
#### [ Console ]

**To view scheduled events for your instances**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. The dashboard displays any resources with an associated event under **Scheduled events**.  
![\[Viewing events using the dashboard.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/dashboard-scheduled-events.png)

1. For more detail, choose **Events** in the navigation pane. Any resources with an associated event are displayed. You can filter by characteristics such as event type, resource type, and Availability Zone.  
![\[Viewing events using the Events page.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/events-instance-scheduled-stop.png)

------
#### [ AWS CLI ]

**To view scheduled events for your instances**  
Use the [describe-instance-status](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-status.html) command.

```
aws ec2 describe-instance-status \
    --instance-id i-1234567890abcdef0 \
    --query "InstanceStatuses[].Events"
```

The following example output shows a reboot event.

```
[
    "Events": [
        {
            "InstanceEventId": "instance-event-0d59937288b749b32",
            "Code": "system-reboot",
            "Description": "The instance is scheduled for a reboot",
            "NotAfter": "2019-03-15T22:00:00.000Z",
            "NotBefore": "2019-03-14T20:00:00.000Z",
            "NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
         }

    ]
]
```

The following example output shows an instance retirement event.

```
[
    "Events": [
        {
            "InstanceEventId": "instance-event-0e439355b779n26",                        
            "Code": "instance-stop",
            "Description": "The instance is running on degraded hardware",
            "NotBefore": "2015-05-23T00:00:00.000Z"
        }
    ]
]
```

------
#### [ PowerShell ]

**To view scheduled events for your instances**  
Use the following [Get-EC2InstanceStatus](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceStatus.html) command.

```
(Get-EC2InstanceStatus -InstanceId i-1234567890abcdef0).Events
```

The following example output shows an instance retirement event.

```
Code         : instance-stop
Description  : The instance is running on degraded hardware
NotBefore    : 5/23/2015 12:00:00 AM
```

------
#### [ Instance metadata ]

**To view scheduled events for your instances using instance metadata**  
You can retrieve information about active maintenance events for your instances from the [instance metadata](ec2-instance-metadata.md) by using Instance Metadata Service Version 2 or Instance Metadata Service Version 1.

**IMDSv2**

```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/events/maintenance/scheduled
```

**IMDSv1**

```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/events/maintenance/scheduled
```

The following is example output with information about a scheduled system reboot event, in JSON format.

```
[ 
  {
    "NotBefore" : "21 Jan 2019 09:00:43 GMT",
    "Code" : "system-reboot",
    "Description" : "scheduled reboot",
    "EventId" : "instance-event-0d59937288b749b32",
    "NotAfter" : "21 Jan 2019 09:17:23 GMT",
    "State" : "active"
  } 
]
```

**To view event history about completed or canceled events for your instances using instance metadata**  
You can retrieve information about completed or canceled events for your instances from [instance metadata](ec2-instance-metadata.md) by using Instance Metadata Service Version 2 or Instance Metadata Service Version 1.

**IMDSv2**

```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/events/maintenance/history
```

**IMDSv1**

```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/events/maintenance/history
```

The following is example output with information about a system reboot event that was canceled, and a system reboot event that was completed, in JSON format.

```
[ 
  {
    "NotBefore" : "21 Jan 2019 09:00:43 GMT",
    "Code" : "system-reboot",
    "Description" : "[Canceled] scheduled reboot",
    "EventId" : "instance-event-0d59937288b749b32",
    "NotAfter" : "21 Jan 2019 09:17:23 GMT",
    "State" : "canceled"
  }, 
  {
    "NotBefore" : "29 Jan 2019 09:00:43 GMT",
    "Code" : "system-reboot",
    "Description" : "[Completed] scheduled reboot",
    "EventId" : "instance-event-0d59937288b749b32",
    "NotAfter" : "29 Jan 2019 09:17:23 GMT",
    "State" : "completed"
  }
]
```

------
#### [ AWS Health ]

You can use the AWS Health Dashboard to learn about events that can affect your instance. The Health Dashboard organizes issues in three groups: open issues, scheduled changes, and other notifications. The scheduled changes group contains items that are ongoing or upcoming.

For more information, see [Getting started with your AWS Health Dashboard](https://docs.aws.amazon.com/health/latest/ug/getting-started-health-dashboard.html) in the *AWS Health User Guide*.

------

# Customize scheduled event notifications for your EC2 instances
Customize scheduled event notifications

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:
+ All of the tags that are associated with the affected resource
+ Only specific tags that are associated with the affected resource

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.

**Topics**
+ [

## Include tags in event notifications
](#register-tags)
+ [

## Remove tags from event notifications
](#deregister-tags)
+ [

## View the tags to be included in event notifications
](#view-tags)

## Include tags in event notifications


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.

------
#### [ Console ]

**To include tags in event notifications**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Actions**, **Manage event notifications**.

1. Turn on **Include tags in event notifications**.

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

1. Choose **Save**.

------
#### [ AWS CLI ]

**To include all tags in event notifications**  
Use the [register-instance-event-notification-attributes](https://docs.aws.amazon.com/cli/latest/reference/ec2/register-instance-event-notification-attributes.html) 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](https://docs.aws.amazon.com/cli/latest/reference/ec2/register-instance-event-notification-attributes.html) 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"]'
```

------
#### [ PowerShell ]

**To include all tags in event notifications**  
Use the [Register-EC2InstanceEventNotificationAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2InstanceEventNotificationAttribute.html) cmdlet.

```
Register-EC2InstanceEventNotificationAttribute `
    -InstanceTagAttribute_IncludeAllTagsOfInstance $true
```

**To include specific tags in event notifications**  
Use the [Register-EC2InstanceEventNotificationAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2InstanceEventNotificationAttribute.html) cmdlet.

```
Register-EC2InstanceEventNotificationAttribute `
    -InstanceTagAttribute_InstanceTagKey tag_key_1, tag_key_2, tag_key_3
```

------

## Remove tags from event notifications


You can remove tags from event notifications.

------
#### [ Console ]

**To remove tags from event notifications**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Actions**, **Manage event notifications**.

1. To remove all tags from event notifications, turn off **Include tags in event notifications**.

1. To remove specific tags from event notifications, choose the **X**) for the corresponding tag keys.

1. Choose **Save**.

------
#### [ AWS CLI ]

**To remove all tags from event notifications**  
Use the [deregister-instance-event-notification-attributes](https://docs.aws.amazon.com/cli/latest/reference/ec2/deregister-instance-event-notification-attributes.html) command and set the `IncludeAllTagsOfInstance` parameter to `false`.

```
aws ec2 deregister-instance-event-notification-attributes \
    --instance-tag-attribute "IncludeAllTagsOfInstance=false"
```

**To remove a tag from event notifications**  
Use the [deregister-instance-event-notification-attributes](https://docs.aws.amazon.com/cli/latest/reference/ec2/deregister-instance-event-notification-attributes.html) 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_3"]'
```

------
#### [ PowerShell ]

**To remove all tags from event notifications**  
Use the [Unregister-EC2InstanceEventNotificationAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2InstanceEventNotificationAttribute.html) cmdlet.

```
Unregister-EC2InstanceEventNotificationAttribute `
    -InstanceTagAttribute_IncludeAllTagsOfInstance $false
```

**To remove a tag from event notifications**  
Use the [Unregister-EC2InstanceEventNotificationAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2InstanceEventNotificationAttribute.html) cmdlet.

```
Unregister-EC2InstanceEventNotificationAttribute `
    -InstanceTagAttribute_InstanceTagKey tag_key_3
```

------

## View the tags to be included in event notifications


You can view the tags that are to be included in event notifications.

------
#### [ Console ]

**To view the tags that are to be included in event notifications**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Actions**, **Manage event notifications**.

------
#### [ AWS CLI ]

**To view the tags to be included in event notifications**  
Use the [describe-instance-event-notification-attributes](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-event-notification-attributes.html) command.

```
aws ec2 describe-instance-event-notification-attributes
```

------
#### [ PowerShell ]

**To view the tags to be included in event notifications**  
Use the [Get-EC2InstanceEventNotificationAttribute](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceEventNotificationAttribute.html) cmdlet.

```
Get-EC2InstanceEventNotificationAttribute
```

------

# Reschedule a scheduled event for an EC2 instance
Reschedule scheduled events

You can reschedule an event so that it occurs at a specific date and time that suits you. After you reschedule an event, it might take a minute or two before the the updated date is displayed.

**Limitations**
+ Only events with an event deadline date can be rescheduled. The event can be rescheduled up to the event deadline date. The event deadline date is indicated in the **Deadline** column (console) and the `NotBeforeDeadline` field (AWS CLI).
+ Only events that have not yet started can be rescheduled. The start time is indicated in the **Start time** column (console) and the `NotBefore` field (AWS CLI). Events that are scheduled to start in the next 5 minutes can't be rescheduled.
+ The new event start time must be at least 60 minutes from the current time.
+ If you reschedule multiple events using the console, the event deadline date is determined by the event with the earliest event deadline date. 

------
#### [ Console ]

**To reschedule an event**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Resource type: instance** from the filter list.

1. Select one or more instances, and then choose **Actions**, **Schedule event**.

   Only events that have an event deadline date, indicated by a value for **Deadline**, can be rescheduled. If one of the selected events does not have a deadline date, **Actions**, **Schedule event** is disabled.

1. For **New start time**, enter a new date and time for the event. The new date and time must occur before the **Event deadline**.

1. Choose **Save**.

   It might take a minute or two for the updated event start time to be reflected in the console.

------
#### [ AWS CLI ]

**To reschedule an event**  
Use the [https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-event-start-time.html](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-event-start-time.html) command.

```
aws ec2 modify-instance-event-start-time \
    --instance-id i-1234567890abcdef0 \
    --instance-event-id instance-event-0d59937288b749b32 \
    --not-before 2020-03-25T10:00:00.000
```

------
#### [ PowerShell ]

**To reschedule an event**  
Use the [Edit-EC2InstanceEventStartTime](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceEventStartTime.html) cmdlet.

```
Edit-EC2InstanceEventStartTime `
    -InstanceId i-1234567890abcdef0 `
    -InstanceEventId instance-event-0d59937288b749b32 `
    -NotBefore 2020-03-25T10:00:00.000
```

------

# Create custom event windows for scheduled events that affect your Amazon EC2 instances
Create custom event windows

You can define custom event windows that recur weekly for scheduled events that reboot, stop, or terminate your Amazon EC2 instances. You can associate one or more instances with an event window. If a scheduled event for those instances is planned, AWS will schedule the events within the associated event window.

You can use event windows to maximize workload availability by specifying event windows that occur during off-peak periods for your workload. You can also align the event windows with your internal maintenance schedules.

You define an event window by specifying a set of time ranges. The minimum time range is 2 hours. The combined time ranges must total at least 4 hours.

You can associate one or more instances with an event window by using either instance IDs or instance tags. You can also associate Dedicated Hosts with an event window by using the host ID.

**Warning**  
Event windows are applicable only for scheduled events that stop, reboot, or terminate instances.  
Event windows are not applicable for:  
Expedited scheduled events and network maintenance events. 
Unscheduled maintenance such as [automatic instance recovery](ec2-instance-recover.md) and unplanned reboots.

**Topics**
+ [

## Considerations
](#event-windows-considerations)
+ [

## Create an event window
](#create-event-windows)
+ [

## Associate a target with an event window
](#associate-target-event-window)
+ [

## Disassociate a target from an event window
](#disassociate-target-event-window)
+ [

## Modify an event window
](#modify-event-windows)
+ [

## Delete an event window
](#delete-event-windows)

## Considerations

+ All event window times are in UTC.
+ An event window can contain multiple time ranges. While each individual range must be at least 2 hours, the total duration across all ranges must be at least 4 hours.
+ Only one target type (instance ID, Dedicated Host ID, or instance tag) can be associated with an event window.
+ A target (instance ID, Dedicated Host ID, or instance tag) can only be associated with one event window.
+ A maximum of 100 instance IDs, or 50 Dedicated Host IDs, or 50 instance tags can be associated with an event window. The instance tags can be associated with any number of instances.
+ A maximum of 200 event windows can be created per AWS Region.
+ Multiple instances that are associated with event windows can potentially have scheduled events occur at the same time.
+ If AWS has already scheduled an event, modifying an event window won't change the time of the scheduled event. If the event has a deadline date, you can [reschedule the event](reschedule-event.md).
+ You can stop and start an instance before the scheduled event. This migrates the instance to a new host and clears the event.

## Create an event window


You can create one or more event windows. For each event window, you specify one or more blocks of time. For example, you can create an event window with blocks of time that occur every day at 4 AM for 2 hours. Or you can create an event window with blocks of time that occur on Sundays from 2 AM to 4 AM and on Wednesdays from 3 AM to 5 AM.

Event windows recur weekly until you delete them.

------
#### [ Console ]

**To create an event window**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Actions**, **Manage event windows**.

1. Choose **Create instance event window**.

1. For **Event window name**, enter a descriptive name for the event window.

1. For **Event window schedule**, choose to specify the blocks of time in the event window by using the cron schedule builder or by specifying time ranges.
   + If you choose **Cron schedule builder**, specify the following:

     1. For **Days (UTC)**, specify the days of the week on which the event window occurs.

     1. For **Start time (UTC)**, specify the time when the event window begins.

     1. For **Duration**, specify the duration of the blocks of time in the event window. The minimum duration per block of time is 2 hours. The minimum duration of the event window must equal or exceed 4 hours in total. All times are in UTC.
   + If you choose **Time ranges**, choose **Add new time range** and specify the start day and time and the end day and time. Repeat for each time range. The minimum duration per time range is 2 hours. The minimum duration for all time ranges combined must equal or exceed 4 hours in total.

1. (Optional) For **Target details**, associate one or more instances with the event window. Use instance IDs or instance tags to associate instances. Use host IDs to associate Dedicated Hosts. When these targets are scheduled for maintenance, the event will occur during this event window. 

   Note that you can create the event window without associating a target with the window. Later, you can modify the window to associate one or more targets.

1. (Optional) For **Event window tags**, choose **Add tag**, and enter the key and value for the tag. Repeat for each tag.

1. Choose **Create event window**.

------
#### [ AWS CLI ]

**To create an event window with a time range**  
Use the [create-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-instance-event-window.html) command.

```
aws ec2 create-instance-event-window \
    --time-range StartWeekDay=monday,StartHour=2,EndWeekDay=wednesday,EndHour=8 \
    --tag-specifications "ResourceType=instance-event-window,Tags=[{Key=K1,Value=V1}]" \
    --name myEventWindowName
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "TimeRanges": [
            {
                "StartWeekDay": "monday",
                "StartHour": 2,
                "EndWeekDay": "wednesday",
                "EndHour": 8
            }
        ],
        "Name": "myEventWindowName",
        "State": "creating",
        "Tags": [
            {
                "Key": "K1",
                "Value": "V1"
            }
        ]
    }
}
```

**To create an event window with a cron expression**  
Use the [create-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-instance-event-window.html) command.

```
aws ec2 create-instance-event-window \
    --cron-expression "* 21-23 * * 2,3" \
    --tag-specifications "ResourceType=instance-event-window,Tags=[{Key=K1,Value=V1}]" \
    --name myEventWindowName
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "State": "creating",
        "Tags": [
            {
                "Key": "K1",
                "Value": "V1"
            }
        ]
    }
}
```

------
#### [ PowerShell ]

**To create an event window with a time range**  
Use the [New-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2InstanceEventWindow.html) cmdlet.

```
$timeRange = New-Object Amazon.EC2.Model.InstanceEventWindowTimeRangeRequest
$timeRange.StartWeekDay = "monday"
$timeRange.EndWeekDay = "wednesday"
$timeRange.StartHour = 2
$timeRange.EndHour = 8
$tag = @{Key="key1"; Value="value1"}
$tagspec = New-Object Amazon.EC2.Model.TagSpecification
$tagspec.ResourceType = "instance-event-window"
$tagspec.Tags.Add($tag)
New-EC2InstanceEventWindow `
    -Name my-event-window `
    -TagSpecification $tagspec `
    -TimeRange @($timeRange)
```

The following is example output.

```
AssociationTarget     : 
CronExpression        : 
InstanceEventWindowId : iew-0abcdef1234567890
Name                  : my-event-window
State                 : creating
Tags                  : {key1}
TimeRanges            : {Amazon.EC2.Model.InstanceEventWindowTimeRange}
```

**To create an event window with a cron expression**  
Use the [New-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2InstanceEventWindow.html) cmdlet.

```
$tag = @{Key="key1"; Value="value1"}
$tagspec = New-Object Amazon.EC2.Model.TagSpecification
$tagspec.ResourceType = "instance-event-window"
$tagspec.Tags.Add($tag)
New-EC2InstanceEventWindow `
    -Name my-event-window `
    -TagSpecification $tagspec`
    -CronExpression "* 21-23 * * 2,3"
```

The following is example output.

```
AssociationTarget     : 
CronExpression        : * 21-23 * * 2,3
InstanceEventWindowId : iew-0abcdef1234567890
Name                  : my-event-window
State                 : creating
Tags                  : {key1}
TimeRanges            : {}
```

------

## Associate a target with an event window


After you create an event window, you can associate targets with the event window. You can associate only one type of target with an event window. You can specify instance IDs, Dedicated Host IDs, or instance tags.

------
#### [ Console ]

**To associate targets with an event window**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Select the event window to modify.

1. Choose **Actions**, **Modify instance event window**.

------
#### [ AWS CLI ]

**To associate instance tags with an event window**  
Use the [associate-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/associate-instance-event-window.html) command.

```
aws ec2 associate-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --association-target "InstanceTags=[{Key=k2,Value=v2},{Key=k1,Value=v1}]"
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [],
            "Tags": [
                {
                    "Key": "k2",
                    "Value": "v2"
                },
                {
                    "Key": "k1",
                    "Value": "v1"
                }
            ],
            "DedicatedHostIds": []
        },
        "State": "creating"
    }
}
```

**To associate instance IDs with an event window**  
Use the [associate-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/associate-instance-event-window.html) command.

```
aws ec2 associate-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --association-target "InstanceIds=i-1234567890abcdef0,i-0598c7d356eba48d7"
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [
                "i-1234567890abcdef0",
                "i-0598c7d356eba48d7"
            ],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating"
    }
}
```

**To associate a Dedicated Host with an event window**  
Use the [associate-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/associate-instance-event-window.html) command.

```
aws ec2 associate-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --association-target "DedicatedHostIds=h-029fa35a02b99801d"
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [],
            "Tags": [],
            "DedicatedHostIds": [
                "h-029fa35a02b99801d"
            ]
        },
        "State": "creating"
    }
}
```

------
#### [ PowerShell ]

**To associate instance tags with an event window**  
Use the [Register-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2InstanceEventWindow.html) cmdlet.

```
$tag1 = @{Key="key1"; Value="value1"}
$tag2 = @{Key="key2"; Value="value2"}
Register-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -AssociationTarget_InstanceTag @($tag1,$tag2)
```

**To associate instance IDs with an event window**  
Use the [Register-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2InstanceEventWindow.html) cmdlet.

```
Register-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -AssociationTarget_InstanceId i-1234567890abcdef0, i-0598c7d356eba48d7
```

**To associate a Dedicated Host with an event window**  
Use the [Register-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2InstanceEventWindow.html) cmdlet.

```
Register-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -AssociationTarget_DedicatedHostId h-029fa35a02b99801d
```

------

## Disassociate a target from an event window


------
#### [ Console ]

**To disassociate targets with an event window**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Select the event window to modify.

1. Choose **Actions**, **Modify instance event window**.

------
#### [ AWS CLI ]

**To disassociate instance tags from an event window**  
Use the [disassociate-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference//ec2/disassociate-instance-event-window.html) command.

```
aws ec2 disassociate-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --association-target "InstanceTags=[{Key=k2,Value=v2},{Key=k1,Value=v1}]"
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating"
    }
}
```

**To disassociate instance IDs from an event window**  
Use the [disassociate-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/disassociate-instance-event-window.html) command.

```
aws ec2 disassociate-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --association-target "InstanceIds=i-1234567890abcdef0,i-0598c7d356eba48d7"
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating"
    }
}
```

**To disassociate a Dedicated Host from an event window**  
Use the [disassociate-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/disassociate-instance-event-window.html) command.

```
aws ec2 disassociate-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --association-target DedicatedHostIds=h-029fa35a02b99801d
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating"
    }
}
```

------
#### [ PowerShell ]

**To disassociate instance tags from an event window**  
Use the [Unregister-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2InstanceEventWindow.html) cmdlet.

```
$tag1 = @{Key="key1"; Value="value1"}
$tag2 = @{Key="key2"; Value="value2"}
Unregister-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -AssociationTarget_InstanceTag @($tag1, $tag2)
```

**To disassociate instance IDs from an event window**  
Use the [Unregister-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2InstanceEventWindow.html) cmdlet.

```
Unregister-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -AssociationTarget_InstanceId i-1234567890abcdef0, i-0598c7d356eba48d7
```

**To disassociate a Dedicated Host from an event window**  
Use the [Unregister-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2InstanceEventWindow.html) cmdlet.

```
Unregister-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -AssociationTarget_DedicatedHostId h-029fa35a02b99801d
```

------

## Modify an event window


You can modify all of the fields of an event window except its ID. For example, when daylight savings begin, you might want to modify the event window schedule. For existing event windows, you might want to add or remove targets.

You can modify either a time range or a cron expression when modifying the event window, but not both.

------
#### [ Console ]

**To modify an event window**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Actions**, **Manage event windows**.

1. Select the event window to modify, and then choose **Actions**, **Modify instance event window**.

1. Modify the fields in the event window, and then choose **Modify event window**.

------
#### [ AWS CLI ]

**To modify the time range of an event window**  
Use the [modify-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-event-window.html) command.

```
aws ec2 modify-instance-event-window 
    --instance-event-window-id iew-0abcdef1234567890 \
    --time-range StartWeekDay=monday,StartHour=2,EndWeekDay=wednesday,EndHour=8
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "TimeRanges": [
            {
                "StartWeekDay": "monday",
                "StartHour": 2,
                "EndWeekDay": "wednesday",
                "EndHour": 8
            }
        ],
        "Name": "myEventWindowName",
        "AssociationTarget": {
            "InstanceIds": [
                "i-0abcdef1234567890",
                "i-0be35f9acb8ba01f0"
            ],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating",
        "Tags": [
            {
                "Key": "K1",
                "Value": "V1"
            }
        ]
    }
}
```

**To modify a set of time ranges for an event window**  
Use the [modify-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-event-window.html) command.

```
aws ec2 modify-instance-event-window 
    --instance-event-window-id iew-0abcdef1234567890 \
    --time-range '[{"StartWeekDay": "monday", "StartHour": 2, "EndWeekDay": "wednesday", "EndHour": 8},
	  {"StartWeekDay": "thursday", "StartHour": 2, "EndWeekDay": "friday", "EndHour": 8}]'
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "TimeRanges": [
            {
                "StartWeekDay": "monday",
                "StartHour": 2,
                "EndWeekDay": "wednesday",
                "EndHour": 8
            },
            {
                "StartWeekDay": "thursday",
                "StartHour": 2,
                "EndWeekDay": "friday",
                "EndHour": 8
            }
        ],
        "Name": "myEventWindowName",
        "AssociationTarget": {
            "InstanceIds": [
                "i-0abcdef1234567890",
                "i-0be35f9acb8ba01f0"
            ],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating",
        "Tags": [
            {
                "Key": "K1",
                "Value": "V1"
            }
        ]
    }
}
```

**To modify the cron expression of an event window**  
Use the [modify-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-event-window.html) command.

```
aws ec2 modify-instance-event-window 
    --instance-event-window-id iew-0abcdef1234567890 \
    --cron-expression "* 21-23 * * 2,3"
```

The following is example output.

```
{
    "InstanceEventWindow": {
        "InstanceEventWindowId": "iew-0abcdef1234567890",
        "Name": "myEventWindowName",
        "CronExpression": "* 21-23 * * 2,3",
        "AssociationTarget": {
            "InstanceIds": [
                "i-0abcdef1234567890",
                "i-0be35f9acb8ba01f0"
            ],
            "Tags": [],
            "DedicatedHostIds": []
        },
        "State": "creating",
        "Tags": [
            {
                "Key": "K1",
                "Value": "V1"
            }
        ]
    }
}
```

------
#### [ PowerShell ]

**To modify the time range of an event window**  
Use the [Edit-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceEventWindow.html) cmdlet.

```
$timeRange1 = New-Object Amazon.EC2.Model.InstanceEventWindowTimeRangeRequest
$timeRange1.StartWeekDay = "monday"
$timeRange1.EndWeekDay = "wednesday"
$timeRange1.StartHour = 2
$timeRange1.EndHour = 8
$timeRange2 = New-Object Amazon.EC2.Model.InstanceEventWindowTimeRangeRequest
$timeRange2.StartWeekDay = "thursday"
$timeRange2.EndWeekDay = "friday"
$timeRange2.StartHour = 1
$timeRange2.EndHour = 6
Edit-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -TimeRange @($timeRange1, $timeRange2)
```

**To modify the cron expression of an event window**  
Use the [Edit-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstanceEventWindow.html) cmdlet.

```
Edit-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -CronExpression "* 21-23 * * 2,3"
```

------

## Delete an event window


You can delete one event window at a time.

------
#### [ Console ]

**To delete an event window**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Events**.

1. Choose **Actions**, **Manage event windows**.

1. Select the event window to delete, and then choose **Actions**, **Delete instance event window**.

1. When prompted, enter **delete**, and then choose **Delete**.

------
#### [ AWS CLI ]

**To delete an event window**  
Use the [delete-instance-event-window](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-instance-event-window.html) command and specify the event window to delete.

```
aws ec2 delete-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890
```

**To force-delete an event window**  
Use the `--force-delete` parameter if the event window is currently associated with targets.

```
aws ec2 delete-instance-event-window \
    --instance-event-window-id iew-0abcdef1234567890 \
    --force-delete
```

------
#### [ PowerShell ]

**To delete an event window**  
Use the [Remove-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2InstanceEventWindow.html) cmdlet.

```
Remove-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890
```

**To force-delete an event window**  
Use the [Remove-EC2InstanceEventWindow](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2InstanceEventWindow.html) cmdlet.

```
Remove-EC2InstanceEventWindow `
    -InstanceEventWindowId iew-0abcdef1234567890 `
    -ForceDelete $true
```

------

# Monitor your instances using CloudWatch


You can monitor your instances using Amazon CloudWatch, which collects and processes raw data from Amazon EC2 into readable, near real-time metrics. These statistics are recorded for a period of 15 months, so that you can access historical information and gain a better perspective on how your web application or service is performing.

By default, Amazon EC2 sends metric data to CloudWatch in 5-minute periods. To send metric data for your instance to CloudWatch in 1-minute periods, you can enable detailed monitoring on the instance. For more information, see [Manage detailed monitoring for your EC2 instances](manage-detailed-monitoring.md).

The Amazon EC2 console displays a series of graphs based on the raw data from Amazon CloudWatch. Depending on your needs, you might prefer to get data for your instances from Amazon CloudWatch instead of the graphs in the console.

For Amazon CloudWatch billing and cost information, see [ CloudWatch billing and cost](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_billing.html) in the *Amazon CloudWatch User Guide*.

**Topics**
+ [

# Manage CloudWatch alarms for your EC2 instances in the Amazon EC2 console
](ec2-instance-alarms.md)
+ [

# Manage detailed monitoring for your EC2 instances
](manage-detailed-monitoring.md)
+ [

# CloudWatch metrics that are available for your instances
](viewing_metrics_with_cloudwatch.md)
+ [

# Install and configure the CloudWatch agent using the Amazon EC2 console to add additional metrics
](install-and-configure-cloudwatch-agent-using-ec2-console.md)
+ [

# Statistics for CloudWatch metrics for your instances
](monitoring_get_statistics.md)
+ [

# View the monitoring graphs for your instances
](graphs-in-the-aws-management-console.md)
+ [

# Create a CloudWatch alarm for an instance
](using-cloudwatch-createalarm.md)
+ [

# Create alarms that stop, terminate, reboot, or recover an instance
](UsingAlarmActions.md)

# Manage CloudWatch alarms for your EC2 instances in the Amazon EC2 console
Instance alarms

From the **Instances** screen in the Amazon EC2 console, you can manage the Amazon CloudWatch alarms for your instances. In the **Instances** table, the **Alarm status** column provides two console controls: a control for viewing alarms, and another for creating or editing them. The following screenshot indicates these console controls, numbered **1** (**View alarms**) and **2** (a **\$1** sign for creating or editing an alarm).

![\[The controls in the Instances table in the EC2 console for viewing and creating alarms. 1. View alarms 2. Plus sign symbol.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/instance-alarms.png)


## View alarms from the Instances screen


You can view each instance's alarms from the **Instances** screen.

**To view an instance's alarm from the Instances screen**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. In the **Instances** table, for your chosen instance, choose **View alarms** (numbered **1** in the preceding screenshot).

1. In the **Alarm details for *i-1234567890abcdef0*** window, choose the alarm name to view the alarm in the CloudWatch console.

## Create alarms from the Instances screen


You can create an alarm for each instance from the **Instances** screen.

**To create an alarm for an instance from the Instances screen**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. In the **Instances** table, for your chosen instance, choose the plus sign (numbered **2** in the preceding screenshot).

1. In the **Manage CloudWatch alarms** screen, create your alarm. For more information, see [Create a CloudWatch alarm for an instance](using-cloudwatch-createalarm.md).

## Edit alarms from the Instances screen


You can edit the alarm for an instance from the **Instances** screen.

**To edit an alarm for an instance from the Instances screen**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. In the **Instances** table, for your chosen instance, choose the plus sign (numbered **2** in the preceding screenshot).

1. In the **Manage CloudWatch alarms** screen, edit your alarm. For more information, see [Edit or delete a CloudWatch alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Manage-CloudWatch-Alarm.html#Edit-CloudWatch-Alarm) in the *Amazon CloudWatch User Guide*.

# Manage detailed monitoring for your EC2 instances
Manage detailed monitoring

Amazon CloudWatch provides two categories of monitoring: *basic monitoring* and *detailed monitoring*. By default, your instance is configured for basic monitoring. You can optionally enable detailed monitoring to help you more quickly identify and act on operational issues. You can enable or turn off detailed monitoring at launch or when the instance is running or stopped.

Enabling detailed monitoring on an instance does not affect the monitoring of its attached EBS volumes. For more information, see [Amazon CloudWatch metrics for Amazon EBS](https://docs.aws.amazon.com/ebs/latest/userguide/using_cloudwatch_ebs.html).

The following table highlights the differences between basic monitoring and detailed monitoring for your instances.


| Monitoring type | Description | Charges | 
| --- | --- | --- | 
| Basic monitoring |  Status check metrics are available in 1-minute periods. All other metrics are available in 5-minute periods.  | No charge. | 
| Detailed monitoring | You can get metrics in 1-minute periods, provided you enable detailed monitoring for the instance. Once you've enabled detailed monitoring, you can aggregate the data across groups of similar instances. | You are charged per metric that Amazon EC2 sends to CloudWatch. You are not charged for data storage. For more information, see Paid tier on the [Amazon CloudWatch pricing page](https://aws.amazon.com/cloudwatch/pricing/#Paid_tier). | 

**Topics**
+ [

## Required permissions
](#iam-detailed-monitoring)
+ [

## Enable detailed monitoring at launch
](#enable-detailed-monitoring)
+ [

## Manage detailed monitoring
](#disable-detailed-monitoring)

## Required permissions


To enable detailed monitoring for an instance, your user must have permission to use the [https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_MonitorInstances.html](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_MonitorInstances.html) API action. To turn off detailed monitoring for an instance, your user must have permission to use the [https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_UnmonitorInstances.html](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_UnmonitorInstances.html) API action. 

## Enable detailed monitoring at launch


Use the following procedures to enable detailed monitoring at launch. By default, your instance uses basic monitoring.

------
#### [ Console ]

**To enable detailed monitoring when launching an instance**  
When launching an instance using the Amazon EC2 console, under **Advanced details**, select the **Detailed CloudWatch monitoring** checkbox.

------
#### [ AWS CLI ]

**To enable detailed monitoring when launching an instance**  
Use the [run-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command with the `--monitoring` option.

```
--monitoring Enabled=true
```

------
#### [ PowerShell ]

**To enable detailed monitoring when launching an instance**  
Use the [New-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) cmdlet with the `-Monitoring` parameter.

```
-Monitoring $true
```

------

## Manage detailed monitoring


Use the following procedures to manage detailed monitoring for a running or stopped instance.

------
#### [ Console ]

**To manage detailed monitoring**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance.

1. Choose **Actions**, **Monitor and troubleshoot**, **Manage detailed monitoring**.

1. On the **Detailed monitoring** page, for **Detailed monitoring**, do one of the following:
   + Detailed monitoring – Select **Enable**.
   + Basic monitoring – Clear **Enable**.

1. Choose **Confirm**.

------
#### [ AWS CLI ]

**To enable detailed monitoring**  
Use the following [monitor-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/monitor-instances.html) command.

```
aws ec2 monitor-instances --instance-ids i-1234567890abcdef0
```

**To disable detailed monitoring**  
Use the [unmonitor-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/unmonitor-instances.html) command.

```
aws ec2 unmonitor-instances --instance-ids i-1234567890abcdef0
```

------
#### [ PowerShell ]

**To enable detailed monitoring**  
Use the [Start-EC2InstanceMonitoring](https://docs.aws.amazon.com/powershell/latest/reference/items/Start-EC2InstanceMonitoring.html) cmdlet.

```
Start-EC2InstanceMonitoring -InstanceId i-1234567890abcdef0
```

**To disable detailed monitoring**  
Use the [Stop-EC2InstanceMonitoring](https://docs.aws.amazon.com/powershell/latest/reference/items/Stop-EC2InstanceMonitoring.html) cmdlet.

```
Stop-EC2InstanceMonitoring -InstanceId i-1234567890abcdef0
```

------

# CloudWatch metrics that are available for your instances
CloudWatch metrics

Amazon EC2 sends metrics to Amazon CloudWatch. You can use the AWS Management Console, the AWS CLI, or an API to list the metrics that Amazon EC2 sends to CloudWatch. By default, each data point covers the 5 minutes that follow the start time of activity for the instance. If you've enabled detailed monitoring, each data point covers the next minute of activity from the start time. Note that for the Minimum, Maximum, and Average statistics, the minimum granularity for the metrics that EC2 provides is 1 minute.

For information about how to view the available metrics using the AWS Management Console or the AWS CLI, see [View available metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/viewing_metrics_with_cloudwatch.html) in the *Amazon CloudWatch User Guide*.

For information about getting the statistics for these metrics, see [Statistics for CloudWatch metrics for your instances](monitoring_get_statistics.md).

**Topics**
+ [

## Instance metrics
](#ec2-cloudwatch-metrics)
+ [

## Accelerator metrics
](#accelerator-metrics)
+ [

## CPU credit metrics
](#cpu-credit-metrics)
+ [

## Dedicated Host metrics
](#dh-metrics)
+ [

## Amazon EBS metrics for Nitro-based instances
](#ebs-metrics-nitro)
+ [

## Status check metrics
](#status-check-metrics)
+ [

## Traffic mirroring metrics
](#traffic-mirroring-metrics)
+ [

## Auto Scaling group metrics
](#autoscaling-metrics)
+ [

## Amazon EC2 metric dimensions
](#ec2-cloudwatch-dimensions)
+ [

## Amazon EC2 usage metrics
](#service-quota-metrics)

## Instance metrics


The `AWS/EC2` namespace includes the following instance metrics.


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
| CPUUtilization |  The percentage of physical CPU time that Amazon EC2 uses to run the EC2 instance, which includes time spent to run both the user code and the Amazon EC2 code. At a very high level, `CPUUtilization` is the sum of guest `CPUUtilization` and hypervisor `CPUUtilization`. Tools in your operating system can show a different percentage than CloudWatch due to factors such as legacy device simulation, configuration of non-legacy devices, interrupt-heavy workloads, live migration, and live update.  |  Percent  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| DiskReadOps |  Completed read operations from all instance store volumes available to the instance in a specified period of time. To calculate the average I/O operations per second (IOPS) for the period, divide the total operations in the period by the number of seconds in that period. If there are no instance store volumes, either the value is 0 or the metric is not reported.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| DiskWriteOps |  Completed write operations to all instance store volumes available to the instance in a specified period of time. To calculate the average I/O operations per second (IOPS) for the period, divide the total operations in the period by the number of seconds in that period. If there are no instance store volumes, either the value is 0 or the metric is not reported.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| DiskReadBytes |  Bytes read from all instance store volumes available to the instance. This metric is used to determine the volume of the data the application reads from the hard disk of the instance. This can be used to determine the speed of the application. The number reported is the number of bytes received during the period. If you are using basic (5-minute) monitoring, you can divide this number by 300 to find Bytes/second. If you have detailed (1-minute) monitoring, divide it by 60. You can also use the CloudWatch metric math function `DIFF_TIME` to find the bytes per second. For example, if you have graphed `DiskReadBytes` in CloudWatch as `m1`, the metric math formula `m1/(DIFF_TIME(m1))` returns the metric in bytes/second. For more information about `DIFF_TIME` and other metric math functions, see [Use metric math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html) in the *Amazon CloudWatch User Guide*. If there are no instance store volumes, either the value is 0 or the metric is not reported.  |  Bytes  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| DiskWriteBytes |  Bytes written to all instance store volumes available to the instance. This metric is used to determine the volume of the data the application writes onto the hard disk of the instance. This can be used to determine the speed of the application. The number reported is the number of bytes received during the period. If you are using basic (5-minute) monitoring, you can divide this number by 300 to find Bytes/second. If you have detailed (1-minute) monitoring, divide it by 60. You can also use the CloudWatch metric math function `DIFF_TIME` to find the bytes per second. For example, if you have graphed `DiskWriteBytes` in CloudWatch as `m1`, the metric math formula `m1/(DIFF_TIME(m1))` returns the metric in bytes/second. For more information about `DIFF_TIME` and other metric math functions, see [Use metric math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html) in the *Amazon CloudWatch User Guide*. If there are no instance store volumes, either the value is 0 or the metric is not reported.  |  Bytes  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| MetadataNoToken |  The number of times the Instance Metadata Service (IMDS) was successfully accessed using a method that does not use a token. This metric is used to determine if there are any processes accessing instance metadata that are using Instance Metadata Service Version 1 (IMDSv1), which does not use a token. If all requests use token-backed sessions, i.e., Instance Metadata Service Version 2 (IMDSv2), the value is 0. For more information, see [Transition to using Instance Metadata Service Version 2](instance-metadata-transition-to-version-2.md).  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| MetadataNoTokenRejected |  The number of times an IMDSv1 call was attempted after IMDSv1 was disabled. If this metric appears, it indicates that an IMDSv1 call was attempted and rejected. You can either re-enable IMDSv1 or make sure all of your calls use IMDSv2. For more information, see [Transition to using Instance Metadata Service Version 2](instance-metadata-transition-to-version-2.md).  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| NetworkIn |  The number of bytes received by the instance on all network interfaces. This metric identifies the volume of incoming network traffic to a single instance. The number reported is the number of bytes received during the period. If you are using basic (5-minute) monitoring and the statistic is Sum, you can divide this number by 300 to find Bytes/second. If you have detailed (1-minute) monitoring and the statistic is Sum, divide it by 60.  |  Bytes  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| NetworkOut |  The number of bytes sent out by the instance on all network interfaces. This metric identifies the volume of outgoing network traffic from a single instance. The number reported is the number of bytes sent during the period. If you are using basic (5-minute) monitoring and the statistic is Sum, you can divide this number by 300 to find Bytes/second. If you have detailed (1-minute) monitoring and the statistic is Sum, divide it by 60.  |  Bytes  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| NetworkPacketsIn |  The number of packets received by the instance on all network interfaces. This metric identifies the volume of incoming traffic in terms of the number of packets on a single instance. This metric is available for basic monitoring only (5-minute periods). To calculate the number of packets per second (PPS) your instance received for the 5 minutes, divide the Sum statistic value by 300.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| NetworkPacketsOut |  The number of packets sent out by the instance on all network interfaces. This metric identifies the volume of outgoing traffic in terms of the number of packets on a single instance. This metric is available for basic monitoring only (5-minute periods). To calculate the number of packets per second (PPS) your instance sent for the 5 minutes, divide the Sum statistic value by 300.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

## Accelerator metrics


The `AWS/EC2` namespace includes the following accelerator metric for your [accelerated computing instances](https://docs.aws.amazon.com/ec2/latest/instancetypes/ac.html). Only supported on a subset of accelerated computing instance types.


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
| GPUPowerUtilization | Active power usage as a percentage of maximum active power. | Percent |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

## CPU credit metrics


The `AWS/EC2` namespace includes the following CPU credit metrics for your [burstable performance instances](burstable-performance-instances.md).


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
| CPUCreditUsage |  The number of CPU credits spent by the instance for CPU utilization. One CPU credit equals one vCPU running at 100% utilization for one minute or an equivalent combination of vCPUs, utilization, and time (for example, one vCPU running at 50% utilization for two minutes or two vCPUs running at 25% utilization for two minutes). CPU credit metrics are available at a 5-minute frequency only. If you specify a period greater than five minutes, use the `Sum` statistic instead of the `Average` statistic.  |  Credits (vCPU-minutes)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| CPUCreditBalance |  The number of earned CPU credits that an instance has accrued since it was launched or started. For T2 Standard, the `CPUCreditBalance` also includes the number of launch credits that have been accrued. Credits are accrued in the credit balance after they are earned, and removed from the credit balance when they are spent. The credit balance has a maximum limit, determined by the instance size. After the limit is reached, any new credits that are earned are discarded. For T2 Standard, launch credits do not count towards the limit. The credits in the `CPUCreditBalance` are available for the instance to spend to burst beyond its baseline CPU utilization. When an instance is running, credits in the `CPUCreditBalance` do not expire. When a T3 or T3a instance stops, the `CPUCreditBalance` value persists for seven days. Thereafter, all accrued credits are lost. When a T2 instance stops, the `CPUCreditBalance` value does not persist, and all accrued credits are lost. CPU credit metrics are available at a 5-minute frequency only.  |  Credits (vCPU-minutes)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| CPUSurplusCreditBalance  |  The number of surplus credits that have been spent by an `unlimited` instance when its `CPUCreditBalance` value is zero. The `CPUSurplusCreditBalance` value is paid down by earned CPU credits. If the number of surplus credits exceeds the maximum number of credits that the instance can earn in a 24-hour period, the spent surplus credits above the maximum incur an additional charge. CPU credit metrics are available at a 5-minute frequency only.  |  Credits (vCPU-minutes)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| CPUSurplusCreditsCharged |  The number of spent surplus credits that are not paid down by earned CPU credits, and which thus incur an additional charge. Spent surplus credits are charged when any of the following occurs:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html) CPU credit metrics are available at a 5-minute frequency only.  |  Credits (vCPU-minutes)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

## Dedicated Host metrics


The `AWS/EC2` namespace includes the following metrics for T3 Dedicated Hosts.


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
|  DedicatedHostCPUUtilization |  The percentage of allocated compute capacity that is currently in use by the instances running on the Dedicated Host.  |  Percent  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

## Amazon EBS metrics for Nitro-based instances


The `AWS/EC2` namespace includes additional Amazon EBS metrics for volumes that are attached to Nitro-based instances that are not bare metal instances.


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
|  InstanceEBSIOPSExceededCheck  |  Reports whether an application attempted to drive IOPS that exceeds the maximum EBS IOPS limits for the instance within the last minute. This metric can be either `0` (IOPS not exceeded) or `1` (IOPS exceeded).  |  None  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  InstanceEBSThroughputExceededCheck  |  Reports whether an application attempted to drive throughput that exceeds the maximum EBS throughput limits for the instance within the last minute. This metric can be either `0` (throughput not exceeded) or `1` (throughput exceeded).  |  None  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  EBSReadOps |  Completed read operations from all Amazon EBS volumes attached to the instance in a specified period of time. To calculate the average read I/O operations per second (Read IOPS) for the period, divide the total operations in the period by the number of seconds in that period. If you are using basic (5-minute) monitoring, you can divide this number by 300 to calculate the Read IOPS. If you have detailed (1-minute) monitoring, divide it by 60. You can also use the CloudWatch metric math function `DIFF_TIME` to find the operations per second. For example, if you have graphed `EBSReadOps` in CloudWatch as `m1`, the metric math formula `m1/(DIFF_TIME(m1))` returns the metric in operations/second. For more information about `DIFF_TIME` and other metric math functions, see [Use metric math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html) in the *Amazon CloudWatch User Guide*.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  EBSWriteOps  |  Completed write operations to all EBS volumes attached to the instance in a specified period of time. To calculate the average write I/O operations per second (Write IOPS) for the period, divide the total operations in the period by the number of seconds in that period. If you are using basic (5-minute) monitoring, you can divide this number by 300 to calculate the Write IOPS. If you have detailed (1-minute) monitoring, divide it by 60. You can also use the CloudWatch metric math function `DIFF_TIME` to find the operations per second. For example, if you have graphed `EBSWriteOps` in CloudWatch as `m1`, the metric math formula `m1/(DIFF_TIME(m1))` returns the metric in operations/second. For more information about `DIFF_TIME` and other metric math functions, see [Use metric math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html) in the *Amazon CloudWatch User Guide*.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  EBSReadBytes  |  Bytes read from all EBS volumes attached to the instance in a specified period of time. The number reported is the number of bytes read during the period. If you are using basic (5-minute) monitoring, you can divide this number by 300 to find Read Bytes/second. If you have detailed (1-minute) monitoring, divide it by 60. You can also use the CloudWatch metric math function `DIFF_TIME` to find the bytes per second. For example, if you have graphed `EBSReadBytes` in CloudWatch as `m1`, the metric math formula `m1/(DIFF_TIME(m1))` returns the metric in bytes/second. For more information about `DIFF_TIME` and other metric math functions, see [Use metric math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html) in the *Amazon CloudWatch User Guide*.  |  Bytes  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  EBSWriteBytes  |  Bytes written to all EBS volumes attached to the instance in a specified period of time. The number reported is the number of bytes written during the period. If you are using basic (5-minute) monitoring, you can divide this number by 300 to find Write Bytes/second. If you have detailed (1-minute) monitoring, divide it by 60. You can also use the CloudWatch metric math function `DIFF_TIME` to find the bytes per second. For example, if you have graphed `EBSWriteBytes` in CloudWatch as `m1`, the metric math formula `m1/(DIFF_TIME(m1))` returns the metric in bytes/second. For more information about `DIFF_TIME` and other metric math functions, see [Use metric math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html) in the *Amazon CloudWatch User Guide*.  |  Bytes  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  EBSIOBalance%  |  Provides information about the percentage of I/O credits remaining in the burst bucket. This metric is available for basic monitoring only. This metric is available only for some `*.4xlarge` instance sizes and smaller that burst to their maximum performance for only 30 minutes at least once every 24 hours. The `Sum` statistic is not applicable to this metric.  |  Percent  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
|  EBSByteBalance%  |  Provides information about the percentage of throughput credits remaining in the burst bucket. This metric is available for basic monitoring only. This metric is available only for some `*.4xlarge` instance sizes and smaller that burst to their maximum performance for only 30 minutes at least once every 24 hours. The `Sum` statistic is not applicable to this metric.  |  Percent  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

For information about the metrics provided for your EBS volumes, see [Metrics for Amazon EBS volumes](https://docs.aws.amazon.com/ebs/latest/userguide/using_cloudwatch_ebs.html#ebs-volume-metrics) in the *Amazon EBS User Guide*. For information about the metrics provided for your EC2 Fleets and Spot Fleets, see [Monitor your EC2 Fleet or Spot Fleet using CloudWatch](ec2-fleet-cloudwatch-metrics.md).

## Status check metrics


By default, status check metrics are available at a 1-minute frequency at no charge. For a newly-launched instance, status check metric data is only available after the instance has completed the initialization state (within a few minutes of the instance entering the `running` state). For more information about EC2 status checks, see [Status checks for Amazon EC2 instances](monitoring-system-instance-status-check.md).

The `AWS/EC2` namespace includes the following status check metrics.


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
| StatusCheckFailed |  Reports whether the instance has passed all status checks in the last minute. This metric can be either `0` (passed) or `1` (failed). By default, this metric is available at a 1-minute frequency at no charge.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| StatusCheckFailed\$1Instance |  Reports whether the instance has passed the instance status check in the last minute. This metric can be either `0` (passed) or `1` (failed). By default, this metric is available at a 1-minute frequency at no charge.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| StatusCheckFailed\$1System |  Reports whether the instance has passed the system status check in the last minute. This metric can be either `0` (passed) or `1` (failed). By default, this metric is available at a 1-minute frequency at no charge.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 
| StatusCheckFailed\$1AttachedEBS |  Reports whether the instance has passed the attached EBS status check in the last minute. This metric can be either `0` (passed) or `1` (failed). By default, this metric is available at a 1-minute frequency at no charge.  |  Count  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

The `AWS/EBS` namespace includes the following status check metric.


| Metric | Description | Unit | Meaningful statistics | 
| --- | --- | --- | --- | 
| VolumeStalledIOCheck |  **Note: **For Nitro instances only. Not published for volumes attached to Amazon ECS and AWS Fargate tasks. Reports whether a volume has passed or failed a *stalled IO check* in the last minute. This metric can be either `0` (passed) or `1` (failed).  |  None  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html)  | 

## Traffic mirroring metrics


The `AWS/EC2` namespace includes metrics for mirrored traffic. For more information, see [Monitor mirrored traffic using Amazon CloudWatch](https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirror-cloudwatch.html) in the *Amazon VPC Traffic Mirroring Guide*.

## Auto Scaling group metrics


The `AWS/AutoScaling` namespace includes metrics for Auto Scaling groups. For more information, see [Monitor CloudWatch metrics for your Auto Scaling groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Amazon EC2 metric dimensions


You can use the following dimensions to refine the metrics listed in the previous tables.


| Dimension | Description | 
| --- | --- | 
|  AutoScalingGroupName  |  This dimension filters the data you request for all instances in a specified capacity group. An *Auto Scaling group* is a collection of instances you define if you're using Auto Scaling. This dimension is available only for Amazon EC2 metrics when the instances are in such an Auto Scaling group. Available for instances with Detailed or Basic Monitoring enabled.  | 
|  ImageId  |  This dimension filters the data you request for all instances running this Amazon EC2 Amazon Machine Image (AMI). Available for instances with Detailed Monitoring enabled.  | 
|  InstanceId  |  This dimension filters the data you request for the identified instance only. This helps you pinpoint an exact instance from which to monitor data.  | 
|  InstanceType  |  This dimension filters the data you request for all instances running with this specified instance type. This helps you categorize your data by the type of instance running. For example, you might compare data from an m1.small instance and an m1.large instance to determine which has the better business value for your application. Available for instances with Detailed Monitoring enabled.  | 

## Amazon EC2 usage metrics


You can use CloudWatch usage metrics to provide visibility into your account's usage of resources. Use these metrics to visualize your current service usage on CloudWatch graphs and dashboards.

Amazon EC2 usage metrics correspond to AWS service quotas. You can configure alarms that alert you when your usage approaches a service quota. For more information about CloudWatch integration with service quotas, see [AWS usage metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Service-Quota-Integration.html) in the *Amazon CloudWatch User Guide*.

Amazon EC2 publishes the following metrics in the `AWS/Usage` namespace.


| Metric | Description | 
| --- | --- | 
| `ResourceCount` |  The number of the specified resources running in your account. The resources are defined by the dimensions associated with the metric. The most useful statistic for this metric is `MAXIMUM`, which represents the maximum number of resources used during the 1-minute period.  | 

The following dimensions are used to refine the usage metrics that are published by Amazon EC2.


| Dimension | Description | 
| --- | --- | 
|  Service  |  The name of the AWS service containing the resource. For Amazon EC2 usage metrics, the value for this dimension is `EC2`.  | 
|  Type  |  The type of entity that is being reported. Currently, the only valid value for Amazon EC2 usage metrics is `Resource`.  | 
|  Resource  |  The type of resource that is running. Currently, the only valid value for Amazon EC2 usage metrics is `vCPU`, which returns information on instances that are running.  | 
|  Class  |  The class of resource being tracked. For Amazon EC2 usage metrics with `vCPU` as the value of the `Resource` dimension, the valid values are `Standard/OnDemand`, `F/OnDemand`, `G/OnDemand`, `Inf/OnDemand`, `P/OnDemand`, and `X/OnDemand`. The values for this dimension define the first letter of the instance types that are reported by the metric. For example, `Standard/OnDemand` returns information about all running instances with types that start with A, C, D, H, I, M, R, T, and Z, and `G/OnDemand` returns information about all running instances with types that start with G.  | 

# Install and configure the CloudWatch agent using the Amazon EC2 console to add additional metrics
Install and configure the CloudWatch agent


|  | 
| --- |
| Installing and configuring the CloudWatch agent using the Amazon EC2 console is in beta for Amazon EC2 and is subject to change. | 

By default, Amazon CloudWatch provides basic metrics, such as `CPUUtilization` and `NetworkIn`, for monitoring your Amazon EC2 instances. To collect additional metrics, you can install the CloudWatch agent on your EC2 instances, and then configure the agent to emit selected metrics. Instead of manually installing and configuring the CloudWatch agent on every EC2 instance, you can use the Amazon EC2 console to do this for you.

You can use the Amazon EC2 console to install the CloudWatch agent on your instances and configure the agent to emit selected metrics.

Alternatively, to complete this process manually, see [Installing the CloudWatch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-on-EC2-Instance.html) in the *Amazon CloudWatch User Guide*. For more information about the CloudWatch agent, see [Collect metrics, logs, and traces using the CloudWatch agent](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html).

**Topics**
+ [

## Prerequisites
](#install-and-configure-cw-agent-prerequisites)
+ [

## How it works
](#install-and-configure-cw-agent-how-it-works)
+ [

## Costs
](#install-and-configure-cw-agent-costs)
+ [

## Install and configure the CloudWatch agent
](#install-and-configure-cw-agent-procedure)

## Prerequisites


To use Amazon EC2 to install and configure the CloudWatch agent, you must meet the user and instance prerequisites described in this section.

**Tip**  
This feature is not available in all AWS Regions. If the menu item described in the installation procedure on this page does not exist in the Amazon EC2 console and you are flexible about where your instances run, try another Region. Otherwise, you can use the manual directions in the *Amazon CloudWatch User Guide* to install and configure the agent.

**User prerequisites**  
To use this feature, your IAM console user or role must have the permissions required for using Amazon EC2 and the following IAM permissions:

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ssm:GetParameter",
                "ssm:PutParameter"
            ],
            "Resource": "arn:aws:ssm:*:*:parameter/EC2-Custom-Metrics-*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "ssm:SendCommand",
                "ssm:ListCommandInvocations",
                "ssm:DescribeInstanceInformation"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:GetInstanceProfile",
                "iam:SimulatePrincipalPolicy"
            ],
            "Resource": "*"
        }
    ]
}
```

------

**Instance prerequisites**
+ Instance state: `running`
+ Supported operating system: Linux
+ AWS Systems Manager Agent (SSM Agent): Installed. Two notes about SSM Agent:
  + SSM Agent is preinstalled on some Amazon Machine Images (AMIs) provided by AWS and trusted third-parties. For information about the supported AMIs and the instructions for installing SSM Agent, see [Amazon Machine Images (AMIs) with SSM Agent preinstalled](https://docs.aws.amazon.com/systems-manager/latest/userguide/ami-preinstalled-agent.html) in the *AWS Systems Manager User Guide*.
  + If you experience issues with the SSM Agent, see [Troubleshooting SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/troubleshooting-ssm-agent.html) in the *AWS Systems Manager User Guide*.
+ IAM permissions for the instance: The following AWS managed policies must be added to an IAM role that is attached to the instance:
  + [AmazonSSMManagedInstanceCore](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonSSMManagedInstanceCore.html) – Enables an instance to use Systems Manager to install and configure the CloudWatch agent.
  + [CloudWatchAgentServerPolicy](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/CloudWatchAgentServerPolicy.html) – Enables an instance to use the CloudWatch agent to write data to CloudWatch.

  For information about how to add IAM permissions to your instance, see [Use instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) in the *IAM User Guide*.

## How it works


Before you can use the Amazon EC2 console to install and configure the CloudWatch agent, you must make sure that your IAM user or role, and the instances on which you want to add metrics, meet certain prerequisites. Then, you can use the Amazon EC2 console to install and configure the CloudWatch agent on your selected instances.

**First meet the [prerequisites](#install-and-configure-cw-agent-prerequisites)**
+ **You need the required IAM permissions** – Before you get started, make sure that your console user or role has the required IAM permissions to use this feature.
+ **Instances** – To use the feature, your EC2 instances must be Linux instances, have the SSM Agent installed, have the required IAM permissions, and be running. 

**Then you can [use the feature](#install-and-configure-cw-agent-procedure)**

1. **Select your instances** – In the Amazon EC2 console, you select the instances on which to install and configure the CloudWatch agent. You then start the process by choosing **Configure CloudWatch agent**.

1. **Validate SSM Agent** – Amazon EC2 checks that the SSM Agent is installed and started on each instance. Any instances that fail this check are excluded from the process. The SSM Agent is used for performing actions on the instance during this process.

1. **Validate IAM permissions** – Amazon EC2 checks that each instance has the required IAM permissions for this process. Any instances that fail this check are excluded from the process. The IAM permissions enable the CloudWatch agent to collect metrics from the instance and integrate with AWS Systems Manager to use the SSM Agent.

1. **Validate CloudWatch agent** – Amazon EC2 checks that the CloudWatch agent is installed and running on each instance. If any instances fail this check, Amazon EC2 offers to install and start the CloudWatch agent for you. The CloudWatch agent will collect the selected metrics on each instance once this process is completed.

1. **Select metric configuration** – You select the metrics for the CloudWatch agent to emit from your instances. Once selected, Amazon EC2 stores a configuration file in Parameter Store, where it remains until the process is completed. Amazon EC2 will delete the configuration file from Parameter Store unless the process is interrupted. Note that if you don't select a metric, but you previously added it to your instance, it will be removed from your instance when this process is completed.

1. **Update CloudWatch agent configuration** – Amazon EC2 sends the metric configuration to the CloudWatch agent. This is the last step in the process. If it succeeds, your instances can emit data for the selected metrics and Amazon EC2 deletes the configuration file from Parameter Store.

## Costs


Additional metrics that you add during this process are billed as custom metrics. For more information about CloudWatch metrics pricing, see [Amazon CloudWatch Pricing](https://aws.amazon.com/cloudwatch/pricing/).

## Install and configure the CloudWatch agent


You can use the Amazon EC2 console to install and configure the CloudWatch agent to add additional metrics.

**Note**  
Every time you perform this procedure, you overwrite the existing CloudWatch agent configuration. If you don't select a metric that was selected previously, it will be removed from the instance.

**To install and configure the CloudWatch agent using the Amazon EC2 console**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instances on which to install and configure the CloudWatch agent.

1. Choose **Actions**, **Monitor and troubleshoot**, **Configure CloudWatch agent**.

1. For each step in the process, read the console text, and then choose **Next**.

1. To complete the process, in the final step, choose **Complete**.

**To update the agent configuration created by the Amazon EC2 console**  
You can manually customize the configuration that the EC2 console created. For more information, see [Manually create or edit the CloudWatch agent configuration file](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html) in the *Amazon CloudWatch User Guide*.

# Statistics for CloudWatch metrics for your instances
Statistics for metrics

You can get statistics for the CloudWatch metrics for your instances. *Statistics* are metric data aggregations over specified periods of time. CloudWatch provides statistics based on the metric data points provided by your custom data or provided by other services in AWS to CloudWatch. Aggregations are made using the namespace, metric name, dimensions, and the data point unit of measure, within the time period you specify. The following table describes the available statistics.


| Statistic | Description | 
| --- | --- | 
| Minimum |  The lowest value observed during the specified period. You can use this value to determine low volumes of activity for your application.   | 
| Maximum |  The highest value observed during the specified period. You can use this value to determine high volumes of activity for your application.   | 
| Sum |  All values submitted for the matching metric added together. This statistic can be useful for determining the total volume of a metric.   | 
| Average |  The value of `Sum` / `SampleCount` during the specified period. By comparing this statistic with the `Minimum` and `Maximum`, you can determine the full scope of a metric and how close the average use is to the `Minimum` and `Maximum`. This comparison helps you to know when to increase or decrease your resources as needed.   | 
| SampleCount |  The count (number) of data points used for the statistical calculation.  | 
| pNN.NN |  The value of the specified percentile. You can specify any percentile, using up to two decimal places (for example, p95.45).  | 

**Topics**
+ [

# Get statistics for a specific instance
](US_SingleMetricPerInstance.md)
+ [

# Aggregate statistics across instances
](GetSingleMetricAllDimensions.md)
+ [

# Aggregate statistics by Auto Scaling group
](GetMetricAutoScalingGroup.md)
+ [

# Aggregate statistics by AMI
](US_SingleMetricPerAMI.md)

# Get statistics for a specific instance


You can use the AWS Management Console or the AWS CLI to get statistics for a specific instance. The following examples show you how to use the AWS Management Console or the AWS CLI to determine the maximum CPU utilization of a specific EC2 instance.

**Requirements**
+ You must have the ID of the instance. You can get the instance ID using the AWS Management Console or the [describe-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command.
+ By default, basic monitoring is enabled, but you can enable detailed monitoring. For more information, see [Manage detailed monitoring for your EC2 instances](manage-detailed-monitoring.md).

**To display the CPU utilization for a specific instance (console)**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**.

1. Choose the **EC2** metric namespace.

1. Choose the **Per-Instance Metrics** dimension.

1. In the search field, enter **CPUUtilization** and press Enter. Choose the row for the specific instance, which displays a graph for the **CPUUtilization** metric for the instance. To name the graph, choose the pencil icon. To change the time range, select one of the predefined values or choose **custom**.  
![\[Graph a single metric\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/metric_statistics_ec2_instance.png)

1. To change the statistic or the period for the metric, choose the **Graphed metrics** tab. Choose the column heading or an individual value, and then choose a different value.  
![\[Change the statistic or period for a metric\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/metric_statistics_ec2_instance_statistic_period.png)

**To get the CPU utilization for a specific instance (AWS CLI)**  
Use the following [get-metric-statistics](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/get-metric-statistics.html) command to get the **CPUUtilization** metric for the specified instance, using the specified period and time interval:

```
aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization  --period 3600 \
--statistics Maximum --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
--start-time 2022-10-18T23:18:00 --end-time 2022-10-19T23:18:00
```

The following is example output. Each value represents the maximum CPU utilization percentage for a single EC2 instance.

```
{
    "Datapoints": [
        {
            "Timestamp": "2022-10-19T00:18:00Z", 
            "Maximum": 0.33000000000000002, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2022-10-19T03:18:00Z", 
            "Maximum": 99.670000000000002, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2022-10-19T07:18:00Z", 
            "Maximum": 0.34000000000000002, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2022-10-19T12:18:00Z", 
            "Maximum": 0.34000000000000002, 
            "Unit": "Percent"
        }
    ], 
    "Label": "CPUUtilization"
}
```

# Aggregate statistics across instances


Aggregate statistics are available for instances that have detailed monitoring enabled. Instances that use basic monitoring are not included in the aggregates. Before you can get statistics aggregated across instances, you must [enable detailed monitoring](manage-detailed-monitoring.md#enable-detailed-monitoring) (at an additional charge), which provides data in 1-minute periods.

Note that Amazon CloudWatch cannot aggregate data across AWS Regions. Metrics are completely separate between Regions.

This example shows you how to use detailed monitoring to get the average CPU usage for your EC2 instances. Because no dimension is specified, CloudWatch returns statistics for all dimensions in the `AWS/EC2` namespace.

**Important**  
This technique for retrieving all dimensions across an AWS namespace does not work for custom namespaces that you publish to Amazon CloudWatch. With custom namespaces, you must specify the complete set of dimensions that are associated with any given data point to retrieve statistics that include the data point. 

**To display average CPU utilization across your instances (console)**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**.

1. Choose the **EC2** namespace and then choose **Across All Instances**.

1. Choose the row that contains **CPUUtilization**, which displays a graph for the metric for all your EC2 instances. To name the graph, choose the pencil icon. To change the time range, select one of the predefined values or choose **custom**.  
![\[Metrics aggregated across your EC2 instances\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/metric_aggregated_instances.png)

1. To change the statistic or the period for the metric, choose the **Graphed metrics** tab. Choose the column heading or an individual value, and then choose a different value.

**To get average CPU utilization across your instances (AWS CLI)**  
Use the [get-metric-statistics](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/get-metric-statistics.html) command as follows to get the average of the **CPUUtilization** metric across your instances.

```
aws cloudwatch get-metric-statistics \
    --namespace AWS/EC2 \
    --metric-name CPUUtilization \ 
    --period 3600  --statistics "Average" "SampleCount" \ 
    --start-time 2022-10-11T23:18:00 \
    --end-time 2022-10-12T23:18:00
```

The following is example output:

```
{
    "Datapoints": [
        {
            "SampleCount": 238.0, 
            "Timestamp": "2022-10-12T07:18:00Z", 
            "Average": 0.038235294117647062, 
            "Unit": "Percent"
        }, 
        {
            "SampleCount": 240.0, 
            "Timestamp": "2022-10-12T09:18:00Z", 
            "Average": 0.16670833333333332, 
            "Unit": "Percent"
        }, 
        {
            "SampleCount": 238.0, 
            "Timestamp": "2022-10-11T23:18:00Z", 
            "Average": 0.041596638655462197, 
            "Unit": "Percent"
        }
    ], 
    "Label": "CPUUtilization"
}
```

# Aggregate statistics by Auto Scaling group


You can aggregate statistics for the EC2 instances in an Auto Scaling group. Note that Amazon CloudWatch cannot aggregate data across AWS Regions. Metrics are completely separate between Regions.

This example shows you how to retrieve the total bytes written to disk for one Auto Scaling group. The total is computed for 1-minute periods for a 24-hour interval across all EC2 instances in the specified Auto Scaling group.

**To display DiskWriteBytes for the instances in an Auto Scaling group (console)**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**.

1. Choose the **EC2** namespace and then choose **By Auto Scaling Group**.

1. Choose the row for the **DiskWriteBytes** metric and the specific Auto Scaling group, which displays a graph for the metric for the instances in the Auto Scaling group. To name the graph, choose the pencil icon. To change the time range, select one of the predefined values or choose **custom**.

1. To change the statistic or the period for the metric, choose the **Graphed metrics** tab. Choose the column heading or an individual value, and then choose a different value.

**To display DiskWriteBytes for the instances in an Auto Scaling group (AWS CLI)**  
Use the [get-metric-statistics](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/get-metric-statistics.html) command as follows.

```
aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name DiskWriteBytes --period 360 \
--statistics "Sum" "SampleCount" --dimensions Name=AutoScalingGroupName,Value=my-asg --start-time 2022-10-16T23:18:00 --end-time 2022-10-18T23:18:00
```

The following is example output:

```
{
    "Datapoints": [
        {
            "SampleCount": 18.0, 
            "Timestamp": "2022-10-19T21:36:00Z", 
            "Sum": 0.0, 
            "Unit": "Bytes"
        }, 
        {
            "SampleCount": 5.0, 
            "Timestamp": "2022-10-19T21:42:00Z", 
            "Sum": 0.0, 
            "Unit": "Bytes"
        }
    ], 
    "Label": "DiskWriteBytes"
}
```

# Aggregate statistics by AMI


You can aggregate statistics by AMI for your instances that have detailed monitoring enabled. Instances that use basic monitoring are not included in the aggregates. Before you can get statistics aggregated across instances, you must [enable detailed monitoring](manage-detailed-monitoring.md#enable-detailed-monitoring) (at an additional charge), which provides data in 1-minute periods.

Note that Amazon CloudWatch cannot aggregate data across AWS Regions. Metrics are completely separate between Regions.

This example shows you how to determine average CPU utilization for all instances that use a specific Amazon Machine Image (AMI). The average is over 60-second time intervals for a one-day period.

**To display the average CPU utilization by AMI (console)**

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1. In the navigation pane, choose **Metrics**.

1. Choose the **EC2** namespace and then choose **By Image (AMI) Id**.

1. Choose the row for the **CPUUtilization** metric and the specific AMI, which displays a graph for the metric for the specified AMI. To name the graph, choose the pencil icon. To change the time range, select one of the predefined values or choose **custom**.

1. To change the statistic or the period for the metric, choose the **Graphed metrics** tab. Choose the column heading or an individual value, and then choose a different value.

**To get the average CPU utilization for an image ID (AWS CLI)**  
Use the [get-metric-statistics](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/get-metric-statistics.html) command as follows.

```
aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization  --period 3600 \
--statistics Average --dimensions Name=ImageId,Value=ami-3c47a355 --start-time 2022-10-10T00:00:00 --end-time 2022-10-11T00:00:00
```

The following is example output. Each value represents an average CPU utilization percentage for the EC2 instances running the specified AMI.

```
{
    "Datapoints": [
        {
            "Timestamp": "2022-10-10T07:00:00Z", 
            "Average": 0.041000000000000009, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2022-10-10T14:00:00Z", 
            "Average": 0.079579831932773085, 
            "Unit": "Percent"
        }, 
        {
            "Timestamp": "2022-10-10T06:00:00Z", 
            "Average": 0.036000000000000011, 
            "Unit": "Percent"
        }
    ], 
    "Label": "CPUUtilization"
}
```

# View the monitoring graphs for your instances
View monitoring graphs

After you launch an instance, you can open the Amazon EC2 console and view the monitoring graphs for the instance on the **Monitoring** tab. Each graph is based on one of the available Amazon EC2 metrics.

The following graphs are available:
+ Average CPU Utilization (Percent)
+ Average Disk Reads (Bytes)
+ Average Disk Writes (Bytes)
+ Maximum Network In (Bytes)
+ Maximum Network Out (Bytes)
+ Summary Disk Read Operations (Count)
+ Summary Disk Write Operations (Count)
+ Summary Status (Any)
+ Summary Status Instance (Count)
+ Summary Status System (Count)

For more information about the metrics and the data they provide to the graphs, see [CloudWatch metrics that are available for your instances](viewing_metrics_with_cloudwatch.md).

**Graph metrics using the CloudWatch console**  
You can also use the CloudWatch console to graph metric data generated by Amazon EC2 and other AWS services. For more information, see [Graphing metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph_metrics.html) in the *Amazon CloudWatch User Guide*.

# Create a CloudWatch alarm for an instance
Create an alarm

You can create a CloudWatch alarm that monitors CloudWatch metrics for one of your instances. CloudWatch will automatically send you a notification when the metric reaches a threshold you specify. You can create a CloudWatch alarm using the Amazon EC2 console, or using the more advanced options provided by the CloudWatch console.

**To create an alarm using the CloudWatch console**  
For examples, see [Creating Amazon CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html) in the *Amazon CloudWatch User Guide*.

**To create an alarm using the Amazon EC2 console**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance and choose **Actions**, **Monitor and troubleshoot**, **Manage CloudWatch alarms**.

1. On the **Manage CloudWatch alarms** detail page, under **Add or edit alarm**, select **Create an alarm**.

1. For **Alarm notification**, choose whether to configure Amazon Simple Notification Service (Amazon SNS) notifications. Enter an existing Amazon SNS topic or enter a name to create a new topic.

1. For **Alarm action**, choose whether to specify an action to take when the alarm is triggered. Choose an action from the list.

1. For **Alarm thresholds**, select the metric and criteria for the alarm. For example, to create an alarm that is triggered when CPU utilization reaches 80% for a 5 minute period, do the following:

   1. Keep the default setting for **Group samples by** (**Average**) and **Type of data to sample** (**CPU utilization**).

   1. Choose **>=** for **Alarm when** and enter **0.80** for **Percent**.

   1. Enter **1** for **Consecutive period** and select **5 minutes** for **Period**.

1. (Optional) For **Sample metric data**, choose **Add to dashboard**.

1. Choose **Create**.

You can edit your CloudWatch alarm settings from the Amazon EC2 console or the CloudWatch console. If you want to delete your alarm, you can do so from the CloudWatch console. For more information, see [Edit or delete a CloudWatch alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Manage-CloudWatch-Alarm.html#Edit-CloudWatch-Alarm) in the *Amazon CloudWatch User Guide*.

# Create alarms that stop, terminate, reboot, or recover an instance


Using Amazon CloudWatch alarm actions, you can create alarms that automatically stop, terminate, reboot, or recover your instances. You can use the stop or terminate actions to help you save money when you no longer need an instance to be running. You can use the reboot and recover actions to automatically reboot those instances or recover them onto new hardware if a system impairment occurs.

**Note**  
For Amazon CloudWatch alarms billing and pricing information, see [ CloudWatch billing and cost](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_billing.html) in the *Amazon CloudWatch User Guide*.

The `AWSServiceRoleForCloudWatchEvents` service-linked role enables AWS to perform alarm actions on your behalf. The first time you create an alarm in the AWS Management Console, the AWS CLI, or the IAM API, CloudWatch creates the service-linked role for you.

There are a number of scenarios in which you might want to automatically stop or terminate your instance. For example, you might have instances dedicated to batch payroll processing jobs or scientific computing tasks that run for a period of time and then complete their work. Rather than letting those instances sit idle (and accrue charges), you can stop or terminate them, which can help you to save money. The main difference between using the stop and the terminate alarm actions is that you can easily start a stopped instance if you need to run it again later, and you can keep the same instance ID and root volume. However, you cannot start a terminated instance. Instead, you must launch a new instance. When an instance is stopped or terminated, data on instance store volumes is lost.

You can add the stop, terminate, reboot, or recover actions to any alarm that is set on an Amazon EC2 per-instance metric, including basic and detailed monitoring metrics provided by Amazon CloudWatch (in the `AWS/EC2` namespace), as well as any custom metrics that include the `InstanceId` dimension, as long as its value refers to a valid running Amazon EC2 instance.

**Important**  
Status check alarms can temporarily enter the `INSUFFICIENT_DATA` state if there are missing metric data points. Although rare, this can happen when there is an interruption in the metric reporting systems, even when an instance is healthy. We recommend that you treat the `INSUFFICIENT_DATA` state as missing data instead of an alarm breach, especially when configuring the alarm to stop, terminate, reboot, or recover an instance.

**Console support**  
You can create alarms using the Amazon EC2 console or the CloudWatch console. The procedures in this documentation use the Amazon EC2 console. For procedures that use the CloudWatch console, see [Create alarms that stop, terminate, reboot, or recover an instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html) in the *Amazon CloudWatch User Guide*.

**Permissions**  
You must have the `iam:CreateServiceLinkedRole` to create or modify an alarm that performs EC2 alarm actions. A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see [Create a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*. 

**Topics**
+ [

## Add stop actions to Amazon CloudWatch alarms
](#AddingStopActions)
+ [

## Add terminate actions to Amazon CloudWatch alarms
](#AddingTerminateActions)
+ [

## Add reboot actions to Amazon CloudWatch alarms
](#AddingRebootActions)
+ [

## Add recover actions to Amazon CloudWatch alarms
](#AddingRecoverActions)
+ [

# Amazon CloudWatch alarm action scenarios
](AlarmActionScenarios.md)

## Add stop actions to Amazon CloudWatch alarms


You can create an alarm that stops an Amazon EC2 instance when a certain threshold has been met. For example, you may run development or test instances and occasionally forget to shut them off. You can create an alarm that is triggered when the average CPU utilization percentage has been lower than 10 percent for 24 hours, signaling that it is idle and no longer in use. You can adjust the threshold, duration, and period to suit your needs, plus you can add an Amazon Simple Notification Service (Amazon SNS) notification so that you receive an email when the alarm is triggered.

Instances that use an Amazon EBS volume as the root volume can be stopped or terminated, whereas instances that use the instance store as the root volume can only be terminated. Data on instance store volumes is lost when the instance is terminated or stopped.

**To create an alarm to stop an idle instance (Amazon EC2 console)**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance and choose **Actions**, **Monitor and troubleshoot**, **Manage CloudWatch alarms**.

   Alternatively, you can choose the plus sign ( ![\[Plus sign.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/add-plus.png) ) in the **Alarm status** column.

1. On the **Manage CloudWatch alarms** page, do the following:

   1. Choose **Create an alarm**.

   1. To receive an email when the alarm is triggered, for **Alarm notification**, choose an existing Amazon SNS topic. You first need to create an Amazon SNS topic using the Amazon SNS console. For more information, see [Using Amazon SNS for application-to-person (A2P) messaging](https://docs.aws.amazon.com/sns/latest/dg/sns-user-notifications.html) in the *Amazon Simple Notification Service Developer Guide*.

   1. Toggle on **Alarm action**, and choose **Stop**.

   1. For **Group samples by** and **Type of data to sample**, choose a statistic and a metric. In this example, choose **Average** and **CPU utilization**.

   1. For **Alarm When** and **Percent**, specify the metric threshold. In this example, specify **<=** and **10** percent.

   1. For **Consecutive period** and **Period**, specify the evaluation period for the alarm. In this example, specify **1** consecutive period of **5 Minutes**.

   1. Amazon CloudWatch automatically creates an alarm name for you. To change the name, for **Alarm name**, enter a new name. Alarm names must contain only ASCII characters.
**Note**  
You can adjust the alarm configuration based on your own requirements before creating the alarm, or you can edit them later. This includes the metric, threshold, duration, action, and notification settings. However, after you create an alarm, you cannot edit its name later.

   1. Choose **Create**.

## Add terminate actions to Amazon CloudWatch alarms


You can create an alarm that terminates an EC2 instance automatically when a certain threshold has been met (as long as termination protection is not enabled for the instance). For example, you might want to terminate an instance when it has completed its work, and you don’t need the instance again. If you might want to use the instance later, you should stop the instance instead of terminating it. Data on instance store volumes is lost when the instance is terminated. For information about enabling and disabling termination protection for an instance, see [Change instance termination protection](Using_ChangingDisableAPITermination.md).

**To create an alarm to terminate an idle instance (Amazon EC2 console)**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance and choose **Actions**, **Monitor and troubleshoot**, **Manage CloudWatch alarms**.

   Alternatively, you can choose the plus sign ( ![\[Plus sign.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/add-plus.png) ) in the **Alarm status** column.

1. On the **Manage CloudWatch alarms** page, do the following:

   1. Choose **Create an alarm**.

   1. To receive an email when the alarm is triggered, for **Alarm notification**, choose an existing Amazon SNS topic. You first need to create an Amazon SNS topic using the Amazon SNS console. For more information, see [Using Amazon SNS for application-to-person (A2P) messaging](https://docs.aws.amazon.com/sns/latest/dg/sns-user-notifications.html) in the *Amazon Simple Notification Service Developer Guide*.

   1. Toggle on **Alarm action**, and choose **Terminate**.

   1. For **Group samples by** and **Type of data to sample**, choose a statistic and a metric. In this example, choose **Average** and **CPU utilization**.

   1. For **Alarm When** and **Percent**, specify the metric threshold. In this example, specify **=>** and **10** percent.

   1. For **Consecutive period** and **Period**, specify the evaluation period for the alarm. In this example, specify **24** consecutive periods of **1 Hour**.

   1. Amazon CloudWatch automatically creates an alarm name for you. To change the name, for **Alarm name**, enter a new name. Alarm names must contain only ASCII characters.
**Note**  
You can adjust the alarm configuration based on your own requirements before creating the alarm, or you can edit them later. This includes the metric, threshold, duration, action, and notification settings. However, after you create an alarm, you cannot edit its name later.

   1. Choose **Create**.

## Add reboot actions to Amazon CloudWatch alarms


You can create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance and automatically reboots the instance. The reboot alarm action is recommended for Instance Health Check failures (as opposed to the recover alarm action, which is suited for System Health Check failures). An instance reboot is equivalent to an operating system reboot. In most cases, it takes only a few minutes to reboot your instance. When you reboot an instance, it remains on the same physical host, so your instance keeps its public DNS name, private IP address, and any data on its instance store volumes.

Rebooting an instance doesn't start a new instance billing period (with a minimum one-minute charge), unlike stopping and restarting your instance. Data on instance store volumes is retained when the instance is rebooted. The instance store volumes must be re-mounted into the filesystem after a reboot. For more information, see [Reboot your Amazon EC2 instance](ec2-instance-reboot.md).

**Important**  
To avoid a race condition between the reboot and recover actions, avoid setting the same number of evaluation periods for a reboot alarm and a recover alarm. We recommend that you set reboot alarms to three evaluation periods of one minute each. For more information, see [Evaluating an alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide*.

**To create an alarm to reboot an instance (Amazon EC2 console)**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance and choose **Actions**, **Monitor and troubleshoot**, **Manage CloudWatch alarms**.

   Alternatively, you can choose the plus sign ( ![\[Plus sign.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/add-plus.png) ) in the **Alarm status** column.

1. On the **Manage CloudWatch alarms** page, do the following:

   1. Choose **Create an alarm**.

   1. To receive an email when the alarm is triggered, for **Alarm notification**, choose an existing Amazon SNS topic. You first need to create an Amazon SNS topic using the Amazon SNS console. For more information, see [Using Amazon SNS for application-to-person (A2P) messaging](https://docs.aws.amazon.com/sns/latest/dg/sns-user-notifications.html) in the *Amazon Simple Notification Service Developer Guide*.

   1. Toggle on **Alarm action**, and choose **Reboot**.

   1. For **Group samples by** and **Type of data to sample**, choose a statistic and a metric. In this example, choose **Average** and **Status check failed: instance**.

   1. For **Consecutive period** and **Period**, specify the evaluation period for the alarm. In this example, enter **3** consecutive periods of **1 Minute**. If **1 Minute is disabled**, you must [enable detailed monitoring](manage-detailed-monitoring.md#enable-detailed-monitoring), or you can choose **5 Minutes** instead.

   1. Amazon CloudWatch automatically creates an alarm name for you. To change the name, for **Alarm name**, enter a new name. Alarm names must contain only ASCII characters.

   1. Choose **Create**.

## Add recover actions to Amazon CloudWatch alarms


You can create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance. If the instance becomes impaired due to an underlying hardware failure or a problem that requires AWS involvement to repair, you can automatically recover the instance. Terminated instances cannot be recovered. A recovered instance is identical to the original instance, including the instance ID, private IP addresses, Elastic IP addresses, and all instance metadata.

CloudWatch prevents you from adding a recovery action to an alarm that is on an instance which does not support recovery actions.

When the `StatusCheckFailed_System` alarm is triggered, and the recover action is initiated, you are notified by the Amazon SNS topic that you chose when you created the alarm and associated the recover action. During instance recovery, the instance is migrated during an instance reboot, and any data that is in-memory is lost. When the process is complete, information is published to the SNS topic you've configured for the alarm. Anyone who is subscribed to this SNS topic receives an email notification that includes the status of the recovery attempt and any further instructions. You notice an instance reboot on the recovered instance.

**Note**  
The recover action can be used only with `StatusCheckFailed_System`, not with `StatusCheckFailed_Instance`.

The following problems can cause system status checks to fail:
+ Loss of network connectivity
+ Loss of system power
+ Software issues on the physical host
+ Hardware issues on the physical host that impact network reachability

The recover action is supported only on instances that meet certain characteristics. For more information, see [Automatic instance recovery](ec2-instance-recover.md).

If your instance has a public IP address, it retains the public IP address after recovery.

**Important**  
To avoid a race condition between the reboot and recover actions, avoid setting the same number of evaluation periods for a reboot alarm and a recover alarm. We recommend that you set recover alarms to two evaluation periods of one minute each. For more information, see [Evaluating an alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide*.

**To create an alarm to recover an instance (Amazon EC2 console)**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Select the instance and choose **Actions**, **Monitor and troubleshoot**, **Manage CloudWatch alarms**.

   Alternatively, you can choose the plus sign ( ![\[Plus sign.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/add-plus.png) ) in the **Alarm status** column.

1. On the **Manage CloudWatch alarms** page, do the following:

   1. Choose **Create an alarm**.

   1. To receive an email when the alarm is triggered, for **Alarm notification**, choose an existing Amazon SNS topic. You first need to create an Amazon SNS topic using the Amazon SNS console. For more information, see [Using Amazon SNS for application-to-person (A2P) messaging](https://docs.aws.amazon.com/sns/latest/dg/sns-user-notifications.html) in the *Amazon Simple Notification Service Developer Guide*.
**Note**  
Users must subscribe to the specified SNS topic to receive email notifications when the alarm is triggered. The AWS account root user always receives email notifications when automatic instance recovery actions occur, even if an SNS topic is not specified or the root user is not subscribed to the specified SNS topic.

   1. Toggle on **Alarm action**, and choose **Recover**.

   1. For **Group samples by** and **Type of data to sample**, choose a statistic and a metric. In this example, choose **Average** and **Status check failed: system**.

   1. For **Consecutive period** and **Period**, specify the evaluation period for the alarm. In this example, enter **2** consecutive periods of **1 Minute**. If **1 Minute is disabled**, you must [enable detailed monitoring](manage-detailed-monitoring.md#enable-detailed-monitoring), or you can choose **5 Minutes** instead.

   1. Amazon CloudWatch automatically creates an alarm name for you. To change the name, for **Alarm name**, enter a new name. Alarm names must contain only ASCII characters.

   1. Choose **Create**.

# Amazon CloudWatch alarm action scenarios


You can use the Amazon EC2 console to create alarm actions that stop or terminate an Amazon EC2 instance when certain conditions are met. In the following screen capture of the console page where you set the alarm actions, we've numbered the settings. We've also numbered the settings in the scenarios that follow, to help you create the appropriate actions.

![\[Manage Cloudwatch alarms page.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/manage-cloudwatch-alarms.png)


## Scenario 1: Stop idle development and test instances


Create an alarm that stops an instance used for software development or testing when it has been idle for at least an hour.


| Setting | Value | 
| --- | --- | 
|  1  |  Stop  | 
|  2  |  Maximum  | 
|  3  |  CPU Utilization  | 
|  4  |  <=  | 
|  5  |  10%  | 
|  6  |  1  | 
|  7  |  1 Hour  | 

## Scenario 2: Stop idle instances


Create an alarm that stops an instance and sends an email when the instance has been idle for 24 hours.


| Setting | Value | 
| --- | --- | 
|  1  |  Stop and email  | 
|  2  |  Average  | 
|  3  |  CPU Utilization  | 
|  4  |  <=  | 
|  5  |  5%  | 
|  6  |  24  | 
|  7  |  1 Hour  | 

## Scenario 3: Send email about web servers with unusually high traffic


Create an alarm that sends email when an instance exceeds 10 GB of outbound network traffic per day.


| Setting | Value | 
| --- | --- | 
|  1  |  Email  | 
|  2  |  Sum  | 
|  3  |  Network Out  | 
|  4  |  >  | 
|  5  |  10 GB  | 
|  6  |  24  | 
|  7  |  1 Hour  | 

## Scenario 4: Stop web servers with unusually high traffic


Create an alarm that stops an instance and send a text message (SMS) if outbound traffic exceeds 1 GB per hour.


| Setting | Value | 
| --- | --- | 
|  1  |  Stop and send SMS  | 
|  2  |  Sum  | 
|  3  |  Network Out  | 
|  4  |  >  | 
|  5  |  1 GB  | 
|  6  |  1  | 
|  7  |  1 Hour  | 

## Scenario 5: Stop an impaired instance


Create an alarm that stops an instance that fails three consecutive status checks (performed at 5-minute intervals).


| Setting | Value | 
| --- | --- | 
|  1  |  Stop  | 
|  2  |  Average  | 
|  3  |  Status Check Failed: System  | 
|  4  |  -  | 
|  5  |  -  | 
|  6  |  1  | 
|  7  |  15 Minutes  | 

## Scenario 6: Terminate instances when batch processing jobs are complete


Create an alarm that terminates an instance that runs batch jobs when it is no longer sending results data.


| Setting | Value | 
| --- | --- | 
|  1  |  Terminate  | 
|  2  |  Maximum  | 
|  3  |  Network Out  | 
|  4  |  <=  | 
|  5  |  100,000 bytes  | 
|  6  |  1  | 
|  7  |  5 Minutes  | 

# Automate Amazon EC2 using EventBridge
Automate using EventBridge

You can use Amazon EventBridge to automate your AWS services and respond automatically to system events, such as application availability issues or resource changes. Events from AWS services are delivered to EventBridge in near real time. You can create rules to indicate which events you're interested in, and the actions to take when an event matches a rule. The actions that can be automatically triggered include the following:
+ Invoke an AWS Lambda function
+ Invoke Amazon EC2 Run Command
+ Relay the event to Amazon Kinesis Data Streams
+ Activate an AWS Step Functions state machine
+ Notify an Amazon SNS topic
+ Notify an Amazon SQS queue

The following are examples of how you can use EventBridge with Amazon EC2:
+ Activate a Lambda function whenever an instance enters the running state.
+ Notify an Amazon SNS topic when an Amazon EBS volume is created or modified.
+ Send a command to one or more Amazon EC2 instances using Amazon EC2 Run Command whenever a certain event in another AWS service occurs.

For more information, see the [Amazon EventBridge User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/).

## Amazon EC2 event types


Amazon EC2 supports the following event types:
+ [EC2 AMI State Change](monitor-ami-events.md#ami-events)
+ [EC2 Fast Launch State-change Notification](win-fast-launch-monitor.md#win-monitor-fast-launch-events)
+ [EC2 Fleet Error](monitor-ec2-fleet-using-eventbridge.md#ec2-fleet-config-not-valid)
+ [EC2 Fleet Information](monitor-ec2-fleet-using-eventbridge.md#ec2-fleet-info)
+ [EC2 Fleet Instance Change](monitor-ec2-fleet-using-eventbridge.md#ec2-fleet-instance-change)
+ [EC2 Fleet Spot Instance Request Change](monitor-ec2-fleet-using-eventbridge.md#ec2-fleet-spot-instance-request-change)
+ [EC2 Fleet State Change](monitor-ec2-fleet-using-eventbridge.md#ec2-fleet-state-change)
+ [EC2 Instance Rebalance Recommendation](rebalance-recommendations.md#cp-eventbridge)
+ [EC2 Instance State-change Notification](monitoring-instance-state-changes.md)
+ [EC2 Spot Fleet Error](monitor-ec2-fleet-using-eventbridge.md#spot-fleet-config-not-valid)
+ [EC2 Spot Fleet Information](monitor-ec2-fleet-using-eventbridge.md#spot-fleet-info)
+ [EC2 Spot Fleet Instance Change](monitor-ec2-fleet-using-eventbridge.md#spot-fleet-instance-change)
+ [EC2 Spot Fleet Spot Instance Request Change](monitor-ec2-fleet-using-eventbridge.md#spot-fleet-spot-instance-request-change)
+ [EC2 Spot Fleet State Change](monitor-ec2-fleet-using-eventbridge.md#spot-fleet-state-change)
+ [EC2 Spot Instance Interruption Warning](spot-instance-termination-notices.md#ec2-spot-instance-interruption-warning-event)
+ [EC2 Spot Instance Request Fulfillment](spot-request-status.md#spot-request-fulfillment-event)
+ [EC2 ODCR Underutilization Notification](cr-eventbridge.md)

For information about the event types supported by Amazon EBS, see [Amazon EventBridge for Amazon EBS](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-cloud-watch-events.html).

# Log Amazon EC2 API calls using AWS CloudTrail
Log API calls using CloudTrail

The Amazon EC2 API is integrated with [AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/), a service that provides a record of actions taken by a user, role, or an AWS service. CloudTrail captures all Amazon EC2 API calls as events. The calls captured include calls made by the console. Using the information collected by CloudTrail, you can determine the request that was made to the Amazon EC2 API, the IP address from which the request was made, and when it was made.

Every event or log entry contains information about who generated the request. The identity information helps you determine the following:
+ Whether the request was made with root user or user credentials.
+ Whether the request was made on behalf of an IAM Identity Center user.
+ Whether the request was made with temporary security credentials for a role or federated user.
+ Whether the request was made by another AWS service.

CloudTrail is active in your AWS account when you create the account and you automatically have access to the CloudTrail **Event history**. The CloudTrail **Event history** provides a viewable, searchable, downloadable, and immutable record of the past 90 days of recorded management events in an AWS Region. For more information, see [Working with CloudTrail Event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*. There are no CloudTrail charges for viewing the **Event history**.

For an ongoing record of events in your AWS account past 90 days, create a trail or a [CloudTrail Lake](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html) event data store.

**CloudTrail trails**  
A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket. All trails created using the AWS Management Console are multi-Region. You can create a single-Region or a multi-Region trail by using the AWS CLI. Creating a multi-Region trail is recommended because you capture activity in all AWS Regions in your account. If you create a single-Region trail, you can view only the events logged in the trail's AWS Region. For more information about trails, see [Creating a trail for your AWS account](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) and [Creating a trail for an organization](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html) in the *AWS CloudTrail User Guide*.  
You can deliver one copy of your ongoing management events to your Amazon S3 bucket at no charge from CloudTrail by creating a trail, however, there are Amazon S3 storage charges. For more information about CloudTrail pricing, see [AWS CloudTrail Pricing](https://aws.amazon.com/cloudtrail/pricing/). For information about Amazon S3 pricing, see [Amazon S3 Pricing](https://aws.amazon.com/s3/pricing/).

**CloudTrail Lake event data stores**  
*CloudTrail Lake* lets you run SQL-based queries on your events. CloudTrail Lake converts existing events in row-based JSON format to [ Apache ORC](https://orc.apache.org/) format. ORC is a columnar storage format that is optimized for fast retrieval of data. Events are aggregated into *event data stores*, which are immutable collections of events based on criteria that you select by applying [advanced event selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors). The selectors that you apply to an event data store control which events persist and are available for you to query. For more information about CloudTrail Lake, see [Working with AWS CloudTrail Lake](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html) in the *AWS CloudTrail User Guide*.  
CloudTrail Lake event data stores and queries incur costs. When you create an event data store, you choose the [pricing option](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html#cloudtrail-lake-manage-costs-pricing-option) you want to use for the event data store. The pricing option determines the cost for ingesting and storing events, and the default and maximum retention period for the event data store. For more information about CloudTrail pricing, see [AWS CloudTrail Pricing](https://aws.amazon.com/cloudtrail/pricing/).

## Amazon EC2 API management events in CloudTrail


[Management events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) provide information about management operations that are performed on resources in your AWS account. These are also known as control plane operations. By default, CloudTrail logs management events.

All Amazon EC2 API actions are logged as management events. For a list of the API actions that are logged to CloudTrail, see the [Amazon EC2 API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/). For example, calls to the [https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html), [https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html), and [https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_StopInstances.html](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_StopInstances.html) actions are logged as management events.

## Amazon EC2 API event examples


An event represents a single request from any source and includes information about the requested API operation, the date and time of the operation, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so events don't appear in any specific order.

The following log file record shows that a user terminated an instance.

```
{
   "Records":[
      {
         "eventVersion":"1.03",
         "userIdentity":{
            "type":"Root",
            "principalId":"123456789012",
            "arn":"arn:aws:iam::123456789012:root",
            "accountId":"123456789012",
            "accessKeyId":"AKIAIOSFODNN7EXAMPLE",
            "userName":"user"
         },
         "eventTime":"2016-05-20T08:27:45Z",
         "eventSource":"ec2.amazonaws.com",
         "eventName":"TerminateInstances",
         "awsRegion":"us-west-2",
         "sourceIPAddress":"198.51.100.1",
         "userAgent":"aws-cli/1.10.10 Python/2.7.9 Windows/7botocore/1.4.1",
         "requestParameters":{
            "instancesSet":{
               "items":[{
                  "instanceId":"i-1a2b3c4d"
               }]
            }
         },
         "responseElements":{
            "instancesSet":{
               "items":[{
                  "instanceId":"i-1a2b3c4d",
                  "currentState":{
                     "code":32,
                     "name":"shutting-down"
                  },
                  "previousState":{
                     "code":16,
                     "name":"running"
                  }
               }]
            }
         },
         "requestID":"be112233-1ba5-4ae0-8e2b-1c302EXAMPLE",
         "eventID":"6e12345-2a4e-417c-aa78-7594fEXAMPLE",
         "eventType":"AwsApiCall",
         "recipientAccountId":"123456789012"
     }
   ]
}
```

For information about CloudTrail record contents, see [CloudTrail record contents](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-record-contents.html) in the *AWS CloudTrail User Guide*.

## Audit connections made using EC2 Instance Connect


You can use AWS CloudTrail to audit the users that connect to your instances using EC2 Instance Connect.

**To audit SSH activity via EC2 Instance Connect using the AWS CloudTrail console**

1. Open the CloudTrail console at [https://console.aws.amazon.com/cloudtrail/](https://console.aws.amazon.com/cloudtrail/).

1. Verify that you are in the correct Region.

1. In the navigation pane, choose **Event history**.

1. For **Filter**, choose **Event source**, **ec2-instance-connect.amazonaws.com**.

1. (Optional) For **Time range**, select a time range.

1. Choose the **Refresh events** icon.

1. The page displays the events that correspond to the [https://docs.aws.amazon.com/ec2-instance-connect/latest/APIReference/API_SendSSHPublicKey.html](https://docs.aws.amazon.com/ec2-instance-connect/latest/APIReference/API_SendSSHPublicKey.html) API calls. Expand an event using the arrow to view additional details, such as the user name and AWS access key that was used to make the SSH connection, and the source IP address.

1. To display the full event information in JSON format, choose **View event**. The **requestParameters** field contains the destination instance ID, OS username, and public key that were used to make the SSH connection.

   ```
   {
       "eventVersion": "1.05",
       "userIdentity": {
           "type": "IAMUser",
           "principalId": "ABCDEFGONGNOMOOCB6XYTQEXAMPLE",
           "arn": "arn:aws:iam::1234567890120:user/IAM-friendly-name",
           "accountId": "123456789012",
           "accessKeyId": "ABCDEFGUKZHNAW4OSN2AEXAMPLE",
           "userName": "IAM-friendly-name",
           "sessionContext": {
               "attributes": {
                   "mfaAuthenticated": "false",
                   "creationDate": "2018-09-21T21:37:58Z"}
           }
       },
       "eventTime": "2018-09-21T21:38:00Z",
       "eventSource": "ec2-instance-connect.amazonaws.com",
       "eventName": "SendSSHPublicKey ",
       "awsRegion": "us-west-2",
       "sourceIPAddress": "123.456.789.012",
       "userAgent": "aws-cli/1.15.61 Python/2.7.10 Darwin/16.7.0 botocore/1.10.60",
       "requestParameters": {
           "instanceId": "i-0123456789EXAMPLE",
           "osUser": "ec2-user",
           "SSHKey": {
               "publicKey": "ssh-rsa ABCDEFGHIJKLMNO01234567890EXAMPLE"
           }
        },
       "responseElements": null,
       "requestID": "1a2s3d4f-bde6-11e8-a892-f7ec64543add",
       "eventID": "1a2w3d4r5-a88f-4e28-b3bf-30161f75be34",
       "eventType": "AwsApiCall",
       "recipientAccountId": "0987654321"
   }
   ```

   If you have configured your AWS account to collect CloudTrail events in an S3 bucket, you can download and audit the information programmatically. For more information, see [Getting and viewing your CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html) in the *AWS CloudTrail User Guide*.

# Monitor .NET and SQL Server applications using CloudWatch Application Insights
Monitor .NET and SQL Server applications

CloudWatch Application Insights helps you monitor your .NET and SQL Server applications that use Amazon EC2 instances along with other [AWS application resources](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/appinsights-what-is.html#appinsights-components). It identifies and sets up key metrics logs and alarms across your application resources and technology stack (for example, your Microsoft SQL Server database, web (IIS) and application servers, OS, load balancers, and queues). It continuously monitors the metrics and logs to detect and correlate anomalies and errors. When errors and anomalies are detected, Application Insights generates events that you can use to set up notifications or take actions. To aid with troubleshooting, it creates automated dashboards for the detected problems, which include correlated metric anomalies and log errors, along with additional insights to point you to the potential root cause. The automated dashboards help you to take swift remedial actions to keep your applications healthy and to prevent impact to the end users of your application.

**Information provided about detected problems:**
+ A short summary of the problem
+ The start time and date of the problem
+ The problem severity: High/Medium/Low
+ The status of the detected problem: In‐progress/Resolved
+ Insights: Automatically generated insights on the detected problem and possible root cause
+ Feedback on insights: Feedback you have provided about the usefulness of the insights generated by CloudWatch Application Insights for .NET and SQL Server
+ Related observations: A detailed view of the metric anomalies and error snippets of relevant logs related to the problem across various application components

**Feedback**  
You can provide feedback on automatically generated insights on detected problems by designating them useful or not useful. Your feedback on the insights, along with your application diagnostics (metric anomalies and log exceptions), are used to improve the future detection of similar problems.

For more information, see the [CloudWatch Application Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-application-insights.html) documentation in the *Amazon CloudWatch User Guide*. 

# Track your Free Tier usage for Amazon EC2
Track your Free Tier usage

When you create your AWS account, you can get started with Amazon EC2 for free using the [AWS Free Tier](https://aws.amazon.com/free). Your Free Tier benefits are different depending on whether you created your account before July 15, 2025, or on or after July 15, 2025. For more information, see [Explore AWS services with AWS Free Tier](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/free-tier.html) in the *AWS Billing User Guide*.

## Free Tier benefits before and after July 15, 2025


The following table compares your Free Tier benefits based on your AWS account creation date:


| Free Tier benefit | Account created before July 15, 2025 | Account created on or after July 15, 2025 | 
| --- | --- | --- | 
| Instance types marked Free tier eligible |  `t2.micro`, `t3.micro`  |  `t3.micro`, `t3.small`, `t4g.micro`, `t4g.small`, `c7i-flex.large`, `m7i-flex.large`  | 
| Amazon EBS volume types marked Free tier eligible |  `standard`, `st1`, `sc1`, `gp2`, and `gp3`  |  `standard`, `st1`, `sc1`, `gp2`, and `gp3`  | 
| AMIs marked Free tier eligible | Check for AMIs marked Free tier eligible. | Check for AMIs marked Free tier eligible. | 
| Usage limit | Restricted to usage limits, after which you are billed pay-as-you-go rates. |  Receive USD \$1100 sign-up credit and earn up to \$1100 in additional credits.  | 
| Free Tier duration | Your Free Tier lasts for 12 months from the date you create your account. During this time, if you exceed your Free Tier usage limits, you are billed pay-as-you-go rates. | Your Free Tier lasts for 6 months from the date you created your account, or when your credits are used up, whichever happens first. You can't exceed your Free Tier limits. | 

**To list the instance types that are free tier eligible**  
Use the [describe-instance-types](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-types.html) command with the `free-tier-eligible` filter.

```
aws ec2 describe-instance-types \
    --filters Name=free-tier-eligible,Values=true \
    --query "InstanceTypes[*].[InstanceType]" \
    --output text | sort
```

**To list the AMIs that are free tier eligible**  
Use the [describe-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command with the `free-tier-eligible` filter.

```
aws ec2 describe-images \
    --filters Name=free-tier-eligible,Values=true \
    --query "Images[*].[ImageId]" \
    --output text | sort
```

## Track Free Tier usage for accounts created before July 15, 2025


**Note**  
***This section only applies to Free Tier users who created AWS accounts before July 15, 2025. If you created your account on or after July 15, 2025, see [Tracking your AWS Free Tier usage](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/tracking-free-tier-usage.html) in the AWS Billing User Guide.***

If you created your account before July 15, 2025, you can use Amazon EC2 without incurring charges if you've been an AWS customer for less than 12 months and you stay within the AWS Free Tier usage limits. It's important to track your Free Tier usage to avoid billing surprises. If you exceed the Free Tier limits, you'll incur standard pay-as-go charges. For more information, see [AWS Free Tier](https://aws.amazon.com/free/).

**Note**  
If you've been an AWS customer for more than 12 months, you're no longer eligible for Free Tier usage and you won't see the **EC2 Free Tier** box that is described in the following procedure.

**To track your Free Tier usage**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **EC2 Dashboard**.

1. Find the **EC2 Free Tier** box (at top right).  
![\[The EC2 Free Tier box in the EC2 Dashboard.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/ec2-free-tier-widget.png)

1. In the **EC2 Free Tier** box, check your Free Tier usage, as follows:
   + Under **EC2 Free Tier offers in use**, take note of the warnings:
     + **End of month forecast** – This warns that you will incur charges this month if you continue with your current usage pattern.
     + **Exceeds Free Tier** – This warns that you've exceeded your Free Tier limits and you're already incurring charges.
   + Under **Offer usage (monthly)**, take note of your usage of Linux instances, Windows instances, and EBS storage. The percentage indicates how much of your Free Tier limits you've used this month. If you're at 100%, you will incur charges for further use.
**Note**  
This information appears only after you've created an instance. However, usage information is not updated in real time; it's updated three times a day.

1. To avoid incurring further charges, delete any resources that are either incurring charges now, or will incur charges if you exceed your Free Tier limit usage.
   + For the instructions to delete your instance, see [Terminate Amazon EC2 instances](terminating-instances.md).
   + To check if you have resources in other Regions that might be incurring charges, in the **EC2 Free Tier** box, choose **View Global EC2 resources** to open the **EC2 Global View**. For more information, see [View resources across Regions using AWS Global View](global-view.md).

1. To view your resource usage for all AWS services under the AWS Free Tier, at the bottom of the **EC2 Free Tier** box, choose **View all AWS Free Tier offers**. For more information, see [Trying services using AWS Free Tier](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html) in the *AWS Billing User Guide*.

# Understand codes for Amazon EC2 in billing and usage reports
Billing and usage reports

When you use Amazon EC2, we include related codes in your AWS billing and usage reports. Reviewing these codes helps you understand your costs and usage patterns for Amazon EC2. Tracking and managing your expenses is essential for optimizing your costs.

The following tables describe the codes for Amazon EC2 that appear in your billing and usage reports. For a list of the Region codes used in the billing and usage reports, see [AWS Region billing codes](https://docs.aws.amazon.com/global-infrastructure/latest/regions/aws-region-billing-codes.html).

**Topics**
+ [

## Instances
](#instances-billing-usage-reports)
+ [

## Bare metal instances
](#bare-metal-instances-billing-usage-reports)
+ [

## Dedicated Hosts
](#dedicated-hosts-billing-usage-reports)
+ [

## Dedicated Instances
](#dedicated-instances-billing-usage-reports)
+ [

## EBS optimization
](#ebs-billing-usage-reports)
+ [

## Capacity Reservations
](#capacity-reservation-billing-usage-reports)

**Related resources**
+ [Amazon EC2 billing and purchasing options](instance-purchasing-options.md)
+ [Understand AMI billing information](ami-billing-info.md)
+ [Amazon EC2 pricing](https://aws.amazon.com/ec2/pricing/)

## Instances



| Code | Description | Units | 
| --- | --- | --- | 
| region-BoxUsage:instance-type | The running time for On-Demand Instances. | Hours | 
| region-HostBoxUsage:instance-type | The running time for instances on Dedicated Hosts. | Hours | 
| region-SpotUsage:instance-type | The running time for Spot Instances. | Hours | 



## Bare metal instances



| Code | Description | Units | 
| --- | --- | --- | 
| region-BoxUsage:instance-family.metal | The running time for bare metal On-Demand Instances. | Hours | 
| region-HostBoxUsage:instance-family.metal | The running time for bare metal instances on Dedicated Hosts. | Hours | 
| region-SpotUsage:instance-family.metal | The running time for bare metal Spot Instances. | Hours | 



## Dedicated Hosts



| Code | Description | Units | 
| --- | --- | --- | 
| region-HostUsage:host-type | The time that Dedicated Hosts are provisioned. | Hours | 
| region-ReservedHostUsage:host-type | The time that Dedicated Host Reservations are applied. | Hours | 



## Dedicated Instances



| Code | Description | Units | 
| --- | --- | --- | 
| region-DedicatedUsage:instance-type | The running time for Dedicated Instances. | Hours \$1 per-Region fee | 



## EBS optimization



| Code | Description | Units | 
| --- | --- | --- | 
| region-EBSOptimized:instance-type | The time that EBS optimization is enabled. | Hours | 



## Capacity Reservations



| Code | Description | Units | 
| --- | --- | --- | 
| region-Reservation:instance-type | The reserved instance time for Capacity Reservations. | Hours | 
| region-UnusedBox:instance-type | The unused reserved instance time for Capacity Reservations. | Hours | 
| region-DedicatedRes:instance-type | The reserved instance time for Dedicated Capacity Reservations. | Hours | 
| region-UnusedDed:instance-type | The unused reserved instance time for Dedicated Capacity Reservations. | Hours | 



# Create an inventory of your EC2 instances
Inventory your EC2 instances

Amazon EC2 provides on-demand, scalable computing capacity. An EC2 instance is a virtual server that runs in the AWS network.

The following table describes the key characteristics of an EC2 instance. A system administrator can use the guidance provided in this guide to get information about these characteristics and use it to configure functionally equivalent servers that run on premises or in the network of another Cloud Provider.


| Characteristic | Description | 
| --- | --- | 
| [Geographic location](#ec2-data-geographic-location) | Amazon EC2 is hosted in all AWS Regions world-wide. You select locations for your instances that put them close to your customers. You can launch instances in multiple locations. | 
| [Hardware specifications](#ec2-data-specifications) | Amazon EC2 provides a wide selection of instance types, optimized for different use cases. The instance types that you select for your instances determine their compute, memory, networking, and storage resources. | 
| [Images](#ec2-data-images) | An Amazon Machine Image (AMI) includes the software to install on your instance at launch. This includes the operating system, software packages, and custom configurations. | 
| [IP addresses and DNS hostnames](#ec2-data-ip-dns) | Instances receive private IP addresses and a private DNS hostname. If you configure a public IP address for an instance, it also receives a public DNS hostname. | 
| [Security group rules](#ec2-data-rules) | The security group rules associated with your instances determines which inbound traffic and outbound traffic is allowed. | 
| [User data](#ec2-data-user-data) | User data is made available to instances at launch. It consists of shell scripts (Linux) or PowerShell scripts (Windows). | 

## Geographic location


Amazon EC2 is available in every AWS Region world-wide. Each Region is a separate geographic area. You can lower network latency when you select Regions for your servers that are close to the majority of your users.

You can use [Amazon EC2 Global View](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/global-view.html) to list your Amazon EC2 instances across all Regions. With the AWS Management Console and the API, you must list the instances for each Region individually.

**Why this matters**  
After you determine where your instances are located, you can decide whether to deploy functionally equivalent servers in the same locations or different locations, depending on your needs.

**To get a summary of your EC2 instances across all Regions**

1. Open the Amazon EC2 Global View console at [https://console.aws.amazon.com/ec2globalview/home](https://console.aws.amazon.com/ec2globalview/home).

1. On the **Region explorer** tab, under **Summary**, check the resource count for **Instances**, which includes the number of instances and the number of Regions. Click the underlined text to see how the instance count is spread across Regions.

1. On the **Global search** tab, select the client filter **Resource type = Instance**. You can filter the results further by specifying a Region or a tag.

**To get the number of EC2 instances in a Region using the AWS CLI**  
Use the following [describe-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command to count the instances in the specified Region. You must run this command in each Region where you have instances.

```
aws ec2 describe-instances \
    --region us-east-2 \
    --query "length(Reservations[*].Instances[])"
```

The following is example output.

```
27
```

To get a list of the instance IDs instead of the count of instances, use the following `--query` parameter instead.

```
--query "Reservations[*].Instances[].InstanceId"
```

## Hardware specifications


The instance type that you specify for an EC2 instance determines the compute, memory, storage, and networking resources that are available to it. Each instance family offers a different balance of compute, memory, network, and storage resources. For more information, see the [Amazon EC2 Instance Types Guide](https://docs.aws.amazon.com/ec2/latest/instancetypes/instance-types.html).

**Why these matter**  
After you determine the hardware specifications for your instances, you can decide the minimum specifications required for functionally equivalent servers.

**To get a summary of the instance types used by your instances**  
Use the following [describe-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command. The **sed** command removes lines with brackets and empty lines. You must run this command in each Region where you have instances.

```
aws ec2 describe-instances \
    --query "Reservations[*].Instances[].InstanceType" | sed 's/[][]//g;/^$/d' | sort | uniq -c | sort -nr
```

The following is example output.

```
  20    "c6i.4xlarge",
   5    "t2.micro",
   2    "g6e.2xlarge",
```

**To get information about specific instance types**  
Use the following [describe-instance-types](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-types.html) command to describe the instance types. The `--query` parameter includes only the specified fields in the output. These are the basic characteristics. You can include any additional fields that you need, or you can refer to [Amazon EC2 instance type specifications](https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-type-specifications.html) in the *Amazon EC2 Instance Types Guide*.

```
aws ec2 describe-instance-types \
    --instance-types c6i.4xlarge t2.micro g6e.2xlarge \
    --query "InstanceTypes[*].[InstanceType,VCpuInfo.DefaultVCpus,MemoryInfo.SizeInMiB,NetworkInfo.NetworkPerformance]" \
    --output table
```

The following is example output. The columns are instance type, vCPUs, memory (GiB), and network bandwidth (Gbps).

```
------------------------------------------------------
|                DescribeInstanceTypes               |
+--------------+-----+--------+----------------------+
|  t2.micro    |  1  |  1024  |  Low to Moderate     |
|  c6i.4xlarge |  16 |  32768 |  Up to 12.5 Gigabit  |
|  g6e.2xlarge |  8  |  65536 |  Up to 20 Gigabit    |
+--------------+-----+--------+----------------------+
```

## Images


An Amazon Machine Image (AMI) provides the software that's installed on your instance at launch, such as the operating system, services, development tools, and applications. You can export an AMI to other formats for use with other servers.

**Why these matter**  
After you determine the AMIs for your instances, you can plan the images required for functionally equivalent servers. It might be possible to export your AMIs to a format that you can use elsewhere. Alternatively, you might need to connect to an instance that you launched from each AMI, confirm what's installed and how it's configured, and ensure that you have a copy of everything that you need.

**To get the AMIs for your instances**  
Use the following [describe-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command. The **sed** command removes lines with brackets and empty lines. You must run this command in each Region where you have instances.

```
aws ec2 describe-instances \
    --query "Reservations[*].Instances[].ImageId" | sed 's/[][]//g;/^$/d' | sort | uniq -c | sort -nr
```

The following is example output.

```
20     "ami-0a70b9d193ae8a79",
 5     "ami-07d9cf938edb0739b",
 2     "ami-09245d5773578a1d6",
```

**To get information about specific AMIs**  
Use the following [describe-images](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html) command. The `--query` parameter includes only the specified fields in the output. You can include any additional fields that you need.

```
aws ec2 describe-images \
    --image-id ami-0a70b9d193ae8a79 ami-07d9cf938edb0739b ami-09245d5773578a1d6 \
    --query "Images[*].{ID:ImageId,CreateDate:CreationDate,Name:Name,Description:Description}"
```

The following is example output.

```
[
    {
        "ID": "ami-0a70b9d193ae8a799",
        "CreateDate": "2025-03-01T02:22:41.000Z",
        "Name": "web-server-3.1",
        "Description": "Image for web servers"
    },
    {
        "ID": "ami-07d9cf938edb0739b",
        "CreateDate": "2025-02-01T23:59:03.000Z",
        "Name": "awesome-application-11.5",
        "Description": "Image for Awesome Application"
    },
    {
        "ID": "ami-09245d5773578a1d6",
        "CreateDate": "2025-01-31T02:22:41.000Z",
        "Name": "monitoring-4.2",
        "Description": "Monitoring software"
    }
]
```

**To create a VM file from an AMI**  
Use the [export-image](https://docs.aws.amazon.com/cli/latest/reference/ec2/export-image.html) command. The supported image formats are VHD (compatible with Citrix Xen and Microsoft Hyper-V), VMDK (compatible with VMware ESX and VMware vSphere), and raw format (compatible with KVM and Xen hypervisors). For information about the requirements and limitations of VM Import/Export, see [VM Import/Export requirements](https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html).

## IP addresses and DNS hostnames


Your users connect to your EC2 instances over the internet using their public DNS hostnames. The public DNS hostname of an EC2 instance resolves to its public IP address. EC2 instances can communicate with each other using their private IP addresses.

**Why these matter**  
IP addresses allow devices to communicate with each other over a local network or the internet. By noting the IP addresses and DNS names of your instances, you can help to ensure that functionally equivalent servers can communicate with the same clients or devices as your instances. For example, you can update your load balancer configuration or the DNS records that you created for your DNS provider.

**To get the IP addresses and DNS hostnames for your instances**  
Use the following [describe-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command. You must run this command in each Region where you have instances. The `--query` parameter includes only the specified fields in the output. You can include any additional fields that you need.

```
aws ec2 describe-instances \
    --query "Reservations[*].Instances[].[InstanceId,PrivateIpAddress,PublicDnsName]" \
    --output table
```

The following is example output. The columns are instance ID, private IPv4 address, and public IPv4 DNS name.

```
----------------------------------------------------------------------------------------
|                                   DescribeInstances                                  |
+---------------------+------------+---------------------------------------------------+
| i-0bac57d7472c89bac | 10.0.2.139 | ec2-192-0-2-142.us-east-2.compute.amazonaws.com   |
| i-0fa8b7678975a3fff | 10.0.14.85 | ec2-198-51-100-56.us-east-2.compute.amazonaws.com |
  ...
  ...
| i-08fd74f3f1595fdbd | 10.0.1.241 | ec2-203.0.113.13.us-east-2.compute.amazonaws.com  |
+---------------------+------------+---------------------------------------------------+
```

## Security group rules


A security group acts as a virtual firewall. After you associate a security group with an EC2 instance, its rules allow inbound and outbound traffic for the EC2 instance over specific ports and protocols.

**Why these matter**  
After you determine the inbound traffic allowed to reach your server and the outbound traffic allowed to leave your server, you can plan the firewall rules needed for functionally equivalent servers.

**To get the security groups for your instances**  
Use the following [describe-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command. The **sed** command removes lines with brackets and empty lines. You must run this command in each Region where you have instances.

```
aws ec2 describe-instances \
    --query "Reservations[*].Instances[].SecurityGroups[].GroupId" | sed 's/[][]//g;/^$/d' | sort | uniq -c | sort -nr
```

The following is example output.

```
27     "sg-01dd3383691d02f42",
10     "sg-08c77cc910c0b3b2c",
 2     "sg-00f4e409629f1a42d",
```

**To get the inbound rules for a security group**  
Use the following [describe-security-group-rules](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-security-group-rules.html) command to display the rules for the specified security group where `IsEgress` is `false`.

```
aws ec2 describe-security-group-rules \
    --filters Name=group-id,Values=sg-01dd3383691d02f42 \
    --query 'SecurityGroupRules[?IsEgress==`false`]'
```

The following is example output. The first rule is the default inbound rule, which allows inbound traffic from all resources that are assigned to this security group. The other rule allows SSH traffic from the IP addresses in the specified prefix list. To describe the CIDR blocks in a prefix list, use the [describe-prefix-lists](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-prefix-lists.html) command.

```
[
    {
        "SecurityGroupRuleId": "sgr-06c8b42574a91db1b",
        "GroupId": "sg-01dd3383691d02f42",
        "GroupOwnerId": "123456789012",
        "IsEgress": false,
        "IpProtocol": "-1",
        "FromPort": -1,
        "ToPort": -1,
        "ReferencedGroupInfo": {
            "GroupId": "sg-01dd3383691d02f42",
            "UserId": "123456789012"
        },
        "Tags": [],
        "SecurityGroupRuleArn": "arn:aws:ec2:us-west-2:123456789012:security-group-rule/sgr-06c8b42574a91db1b"
    },
    {
        "SecurityGroupRuleId": "sgr-0886a5d46afcd1758",
        "GroupId": "sg-01dd3383691d02f42",
        "GroupOwnerId": "123456789012",
        "IsEgress": false,
        "IpProtocol": "tcp",
        "FromPort": 22,
        "ToPort": 22,
        "PrefixListId": "pl-f8a6439125e7bf465",
        "Tags": [],
        "SecurityGroupRuleArn": "arn:aws:ec2:us-east-2:123456789012:security-group-rule/sgr-0886a5d46afcd1758"
    }
]
```

**To get the outbound rules for a security group**  
Use the following [describe-security-group-rules](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-security-group-rules.html) command to display the rules for the specified security group where `IsEgress` is `true`.

```
aws ec2 describe-security-group-rules \
    --filters Name=group-id,Values=sg-01dd3383691d02f42 \
    --query 'SecurityGroupRules[?IsEgress==`true`]'
```

The following is example output. It contains only the default outbound rule, which allows all outbound IPv4 traffic.

```
[
    {
        "SecurityGroupRuleId": "sgr-048f09a719247dce7",
        "GroupId": "sg-01dd3383691d02f42",
        "GroupOwnerId": "123456789012",
        "IsEgress": true,
        "IpProtocol": "-1",
        "FromPort": -1,
        "ToPort": -1,
        "CidrIpv4": "0.0.0.0/0",
        "Tags": [],
        "SecurityGroupRuleArn": "arn:aws:ec2:us-east-2:123456789012:security-group-rule/sgr-048f09a719247dce7"
    }
]
```

## User data


When you launch an EC2 instance, you can pass a shell script to the instance using user data. Note that user data is base64 encoded, so you need to decode the user data to read the script.

**Why this matters**  
If you're running commands at launch as part of setting up your instances, you might need to perform the same tasks when setting up functionally equivalent servers.

**To view the decoded user data for an instance**  
Use the following [describe-instance-attribute](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-attribute.html) command. The **base64** command decodes the user data.

```
aws ec2 describe-instance-attribute \
    --instance-id i-1234567890abcdef0 \
    --attribute userData \
    --output text \
    --query "UserData.Value" | base64 --decode
```

The following is example output.

```
#!/bin/bash
yum update -y
service httpd start
chkconfig httpd on
```

## Related resources


The following are additional characteristics of EC2 instances:
+ [Key pairs](ec2-key-pairs.md)
+ [Storage](Storage.md)
+ [Tags](Using_Tags.md)

You can verify whether you're using the following to launch EC2 instances or distribute traffic between your EC2 instances:
+ [Auto Scaling groups](https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html)
+ [EC2 Fleet](Fleets.md)
+ [Elastic Load Balancing](https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/)