id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
d9ec6d526118-0 | To detach an EFA from an instance, you must first stop the instance\. You cannot detach an EFA from an instance that is in the running state\.
You detach an EFA from an instance in the same way that you detach an elastic network interface from an instance\. For more information, see [Detaching a network interface from an instance](using-eni.md#detach_eni)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/efa-working-with.md |
9adf02bb8ef6-0 | You can view all of the EFAs in your account\.
You view EFAs in the same way that you view elastic network interfaces\. For more information, see [Viewing details about a network interface](using-eni.md#view_eni_details)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/efa-working-with.md |
3175a38e3d52-0 | To delete an EFA, you must first detach it from the instance\. You cannot delete an EFA while it is attached to an instance\.
You delete EFAs in the same way that you delete elastic network interfaces\. For more information, see [Deleting a network interface](using-eni.md#delete_eni)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/efa-working-with.md |
bcd9efacdbdc-0 | You can aggregate statistics for your instances that have detailed monitoring enabled\. Instances that use basic monitoring are not included\. Note that Amazon CloudWatch cannot aggregate data across regions\. Metrics are completely separate between regions\.
Before you can get statistics aggregated across instances, you must enable detailed monitoring \(at an additional charge\), which provides data in 1\-minute periods\. For more information, see [Enable or disable detailed monitoring for your instances](using-cloudwatch-new.md)\.
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**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/US_SingleMetricPerAMI.md |
bcd9efacdbdc-1 | 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 2016-10-10T00:00:00 --end-time 2016-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": "2016-10-10T07:00:00Z",
"Average": 0.041000000000000009,
"Unit": "Percent"
},
{
"Timestamp": "2016-10-10T14:00:00Z", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/US_SingleMetricPerAMI.md |
bcd9efacdbdc-2 | },
{
"Timestamp": "2016-10-10T14:00:00Z",
"Average": 0.079579831932773085,
"Unit": "Percent"
},
{
"Timestamp": "2016-10-10T06:00:00Z",
"Average": 0.036000000000000011,
"Unit": "Percent"
},
...
],
"Label": "CPUUtilization"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/US_SingleMetricPerAMI.md |
dd3f307511d9-0 | Amazon Elastic Compute Cloud \(Amazon EC2\) conforms to the AWS [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/), which includes regulations and guidelines for data protection\. AWS is responsible for protecting the global infrastructure that runs all AWS services\. AWS maintains control over data hosted on this infrastructure, including the security configuration controls for handling customer content and personal data\. AWS customers and APN Partners, acting either as data controllers or data processors, are responsible for any personal data that they put in the AWS Cloud\.
For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts with AWS Identity and Access Management \(IAM\), so that each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways:
+ Use multi\-factor authentication \(MFA\) with each account\.
+ Use TLS to communicate with AWS resources\.
+ Set up API and user activity logging with AWS CloudTrail\.
+ Use AWS encryption solutions, along with all default security controls within AWS services\.
+ Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/data-protection.md |
dd3f307511d9-1 | + Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\.
We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields or metadata, such as function names and tags\. Any data that you enter into metadata might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credential information in the URL to validate your request to that server\.
For more information about data protection, see the [AWS Shared Responsibility Model and GDPR](http://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/data-protection.md |
484a6e816fb2-0 | Amazon EBS encryption is an encryption solution for your EBS volumes and snapshots\. It uses AWS Key Management Service \(AWS KMS\) customer master keys \(CMK\)\. For more information, see [Amazon EBS encryption](EBSEncryption.md)\.
The data on NVMe instance store volumes is encrypted using an XTS\-AES\-256 cipher implemented on a hardware module on the instance\. The encryption keys are generated using the hardware module and are unique to each NVMe instance storage device\. All encryption keys are destroyed when the instance is stopped or terminated and cannot be recovered\. You cannot disable this encryption and you cannot provide your own encryption key\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/data-protection.md |
021c0d2beb52-0 | SSH provides a secure communications channel for remote access to your Linux instances\. Remote access to your instances using AWS Systems Manager Session Manager and Run Command is encrypted using TLS 1\.2, and requests to create a connection are signed using SigV4\.
Use an encryption protocol such as Transport Layer Security \(TLS\) to encrypt sensitive data in transit between clients and your instances\.
AWS provides secure and private connectivity between EC2 instances of all types\. In addition, some instance types use the offload capabilities of the underlying hardware to automatically encrypt in\-transit traffic between instances, using AEAD algorithms with 256\-bit encryption\. There is no impact on network performance\. The following requirements must be met to ensure the additional in\-transit traffic encryption:
+ The instances use the following instance types: C5a, C5ad, C5n, G4, I3en, M5dn, M5n, P3dn, R5dn, and R5n\.
+ The instances are in the same Region\.
+ The instances are in the same VPC or peered VPCs, and the traffic does not pass through a virtual network device, such as a load balancer or a transit gateway\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/data-protection.md |
c02a6f298d87-0 | After you have successfully launched and logged into your Amazon Linux instance, you can make changes to it\. There are many different ways you can configure an instance to meet the needs of a specific application\. The following are some common tasks to help get you started\.
**Topics**
+ [Common configuration scenarios](#configuration-scenarios)
+ [Managing software on your Amazon Linux instance](managing-software.md)
+ [Managing user accounts on your Amazon Linux instance](managing-users.md)
+ [Processor state control for your EC2 instance](processor_state_control.md)
+ [Setting the time for your Linux instance](set-time.md)
+ [Optimizing CPU options](instance-optimize-cpu.md)
+ [Changing the hostname of your Amazon Linux instance](set-hostname.md)
+ [Setting up dynamic DNS on Your Amazon Linux instance](dynamic-dns.md)
+ [Running commands on your Linux instance at launch](user-data.md)
+ [Instance metadata and user data](ec2-instance-metadata.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Configure_Instance.md |
3ba2d623da63-0 | The base distribution of Amazon Linux contains many software packages and utilities that are required for basic server operations\. However, many more software packages are available in various software repositories, and even more packages are available for you to build from source code\. For more information on installing and building software from these locations, see [Managing software on your Amazon Linux instance](managing-software.md)\.
Amazon Linux instances come pre\-configured with an `ec2-user` account, but you may want to add other user accounts that do not have super\-user privileges\. For more information on adding and removing user accounts, see [Managing user accounts on your Amazon Linux instance](managing-users.md)\.
The default time configuration for Amazon Linux instances uses Amazon Time Sync Service to set the system time on an instance\. The default time zone is UTC\. For more information on setting the time zone for an instance or using your own time server, see [Setting the time for your Linux instance](set-time.md)\.
If you have your own network with a domain name registered to it, you can change the hostname of an instance to identify itself as part of that domain\. You can also change the system prompt to show a more meaningful name without changing the hostname settings\. For more information, see [Changing the hostname of your Amazon Linux instance](set-hostname.md)\. You can configure an instance to use a dynamic DNS service provider\. For more information, see [Setting up dynamic DNS on Your Amazon Linux instance](dynamic-dns.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Configure_Instance.md |
3ba2d623da63-1 | When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common configuration tasks and even run scripts after the instance starts\. You can pass two types of user data to Amazon EC2: cloud\-init directives and shell scripts\. For more information, see [Running commands on your Linux instance at launch](user-data.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Configure_Instance.md |
44382ecd36ac-0 | 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\.
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 IAM 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 restart 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 restart a terminated instance\. Instead, you must launch a new instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
44382ecd36ac-1 | 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\.
**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**
If you are an AWS Identity and Access Management \(IAM\) user, you must have the following permissions to create or modify an alarm:
+ `iam:CreateServiceLinkedRole`, `iam:GetPolicy`, `iam:GetPolicyVersion`, and `iam:GetRole` – For all alarms with Amazon EC2 actions
+ `ec2:DescribeInstanceStatus` and `ec2:DescribeInstances` – For all alarms on Amazon EC2 instance status metrics
+ `ec2:StopInstances` – For alarms with stop actions
+ `ec2:TerminateInstances` – For alarms with terminate actions | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
44382ecd36ac-2 | + `ec2:StopInstances` – For alarms with stop actions
+ `ec2:TerminateInstances` – For alarms with terminate actions
+ No specific permissions are needed for alarms with recover actions\.
If you have read/write permissions for Amazon CloudWatch but not for Amazon EC2, you can still create an alarm but the stop or terminate actions won't be performed on the Amazon EC2 instance\. However, if you are later granted permission to use the associated Amazon EC2 APIs, the alarm actions you created earlier are performed\. For more information about IAM permissions, see [Policies and Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the *IAM User Guide*\.
**Topics**
+ [Adding stop actions to Amazon CloudWatch alarms](#AddingStopActions)
+ [Adding terminate actions to Amazon CloudWatch alarms](#AddingTerminateActions)
+ [Adding reboot actions to Amazon CloudWatch alarms](#AddingRebootActions)
+ [Adding recover actions to Amazon CloudWatch alarms](#AddingRecoverActions)
+ [Using the Amazon CloudWatch console to view alarm and action history](#ViewAlarmHistory)
+ [Amazon CloudWatch alarm action scenarios](#AlarmActionScenarios) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
cf4e51767afc-0 | 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 device can be stopped or terminated, whereas instances that use the instance store as the root device can only be terminated\.
**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\. On the **Monitoring** tab, choose **Create Alarm**\.
1. In the **Create Alarm** dialog box, do the following:
1. To receive an email when the alarm is triggered, for **Send a notification to**, choose an existing Amazon SNS topic, or choose **create topic** to create a new one\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
cf4e51767afc-1 | To create a new topic, for **Send a notification to**, enter a name for the topic, and then for **With these recipients**, enter the email addresses of the recipients \(separated by commas\)\. After you create the alarm, you will receive a subscription confirmation email that you must accept before you can get notifications for this topic\.
1. Choose **Take the action**, **Stop this instance**\.
1. For **Whenever**, choose the statistic you want to use and then choose the metric\. In this example, choose **Average** and **CPU Utilization**\.
1. For **Is**, specify the metric threshold\. In this example, enter **10** percent\.
1. For **For at least**, specify the evaluation period for the alarm\. In this example, enter **24** consecutive period\(s\) of **1 Hour**\.
1. To change the name of the alarm, for **Name of alarm**, enter a new name\. Alarm names must contain only ASCII characters\.
If you don't enter a name for the alarm, Amazon CloudWatch automatically creates one for you\.
**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 Alarm**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
76884d6319be-0 | 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\. For information on enabling and disabling termination protection for an instance, see [Enabling termination protection](terminating-instances.md#Using_ChangingDisableAPITermination)\.
**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\. On the **Monitoring** tab, choose **Create Alarm**\.
1. In the **Create Alarm** dialog box, do the following:
1. To receive an email when the alarm is triggered, for **Send a notification to**, choose an existing Amazon SNS topic, or choose **create topic** to create a new one\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
76884d6319be-1 | To create a new topic, for **Send a notification to**, enter a name for the topic, and then for **With these recipients**, enter the email addresses of the recipients \(separated by commas\)\. After you create the alarm, you will receive a subscription confirmation email that you must accept before you can get notifications for this topic\.
1. Choose **Take the action**, **Terminate this instance**\.
1. For **Whenever**, choose a statistic and then choose the metric\. In this example, choose **Average** and **CPU Utilization**\.
1. For **Is**, specify the metric threshold\. In this example, enter **10** percent\.
1. For **For at least**, specify the evaluation period for the alarm\. In this example, enter **24** consecutive period\(s\) of **1 Hour**\.
1. To change the name of the alarm, for **Name of alarm**, enter a new name\. Alarm names must contain only ASCII characters\.
If you don't enter a name for the alarm, Amazon CloudWatch automatically creates one for you\.
**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 Alarm**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
fc2d4ab8b0c6-0 | 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\. For more information, see [Reboot Your Instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-reboot.html) in the *Amazon EC2 User Guide for Linux Instances*\.
**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\)** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
fc2d4ab8b0c6-1 | **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\. On the **Monitoring** tab, choose **Create Alarm**\.
1. In the **Create Alarm** dialog box, do the following:
1. To receive an email when the alarm is triggered, for **Send a notification to**, choose an existing Amazon SNS topic, or choose **create topic** to create a new one\.
To create a new topic, for **Send a notification to**, enter a name for the topic, and for **With these recipients**, enter the email addresses of the recipients \(separated by commas\)\. After you create the alarm, you will receive a subscription confirmation email that you must accept before you can get notifications for this topic\.
1. Select **Take the action**, **Reboot this instance**\.
1. For **Whenever**, choose **Status Check Failed \(Instance\)**\.
1. For **For at least**, specify the evaluation period for the alarm\. In this example, enter **3** consecutive period\(s\) of **1 Minute**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
fc2d4ab8b0c6-2 | 1. To change the name of the alarm, for **Name of alarm**, enter a new name\. Alarm names must contain only ASCII characters\.
If you don't enter a name for the alarm, Amazon CloudWatch automatically creates one for you\.
1. Choose **Create Alarm**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
303cec9108f9-0 | 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\.
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 with the following characteristics: | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
303cec9108f9-1 | + Hardware issues on the physical host that impact network reachability
The recover action is supported only on instances with the following characteristics:
+ Use one of the following instance types: A1, C3, C4, C5, C5a, C5n, C6g, Inf1, M3, M4, M5, M5a, M5n, M6g, P3, R3, R4, R5, R5a, R5n, R6g, T2, T3, T3a, T4g, X1, or X1e
+ Use `default` or `dedicated` instance tenancy
+ Use EBS volumes only \(do not configure instance store volumes\)\. For more information, see ['Recover this instance' is disabled](https://aws.amazon.com/premiumsupport/knowledge-center/recover-this-instance-cloudwatch-enable/)\.
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\)** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
303cec9108f9-2 | **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\. On the **Monitoring** tab, choose **Create Alarm**\.
1. In the **Create Alarm** dialog box, do the following:
1. To receive an email when the alarm is triggered, for **Send a notification to**, choose an existing Amazon SNS topic, or choose **create topic** to create a new one\.
To create a new topic, for **Send a notification to**, enter a name for the topic, and for **With these recipients**, enter the email addresses of the recipients \(separated by commas\)\. After you create the alarm, you will receive a subscription confirmation email that you must accept before you can get email for this topic\.
**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\.
The AWS account root user always receives email notifications when automatic instance recovery actions occur, even if it is not subscribed to the specified SNS topic\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
303cec9108f9-3 | The AWS account root user always receives email notifications when automatic instance recovery actions occur, even if it is not subscribed to the specified SNS topic\.
1. Select **Take the action**, **Recover this instance**\.
1. For **Whenever**, choose **Status Check Failed \(System\)**\.
1. For **For at least**, specify the evaluation period for the alarm\. In this example, enter **2** consecutive period\(s\) of **1 Minute**\.
1. To change the name of the alarm, for **Name of alarm**, enter a new name\. Alarm names must contain only ASCII characters\.
If you don't enter a name for the alarm, Amazon CloudWatch automatically creates one for you\.
1. Choose **Create Alarm**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
c31cd291aad8-0 | You can view alarm and action history in the Amazon CloudWatch console\. Amazon CloudWatch keeps the last two weeks' worth of alarm and action history\.
**To view the history of triggered alarms and actions \(CloudWatch 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 **Alarms**\.
1. Select an alarm\.
1. The **Details** tab shows the most recent state transition along with the time and metric values\.
1. Choose the **History** tab to view the most recent history entries\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
75df403200d2-0 | 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\.
![\[Create Alarm for dialog box\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/CreateAlarmFor.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
41dca880b29c-0 | 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 | CPUUtilization |
| 4 | <= |
| 5 | 10% |
| 6 | 60 minutes |
| 7 | 1 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
32ecd444d442-0 | 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 | CPUUtilization |
| 4 | <= |
| 5 | 5% |
| 6 | 60 minutes |
| 7 | 24 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
989dbbeed146-0 | 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 | NetworkOut |
| 4 | > |
| 5 | 10 GB |
| 6 | 1 day |
| 7 | 1 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
8613dbedfd5f-0 | 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 | NetworkOut |
| 4 | > |
| 5 | 1 GB |
| 6 | 1 hour |
| 7 | 1 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
64c048cd1cf7-0 | Create an alarm that stops an instance when memory utilization reaches or exceeds 90%, so that application logs can be retrieved for troubleshooting\.
**Note**
The MemoryUtilization metric is a custom metric\. In order to use the MemoryUtilization metric, you must install the Perl scripts for Linux instances\. For more information, see [Monitoring Memory and Disk Metrics for Amazon EC2 Linux Instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html)\.
| Setting | Value |
| --- | --- |
| 1 | Stop |
| 2 | Maximum |
| 3 | MemoryUtilization |
| 4 | >= |
| 5 | 90% |
| 6 | 1 minute |
| 7 | 1 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
436e72ece35c-0 | 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 | StatusCheckFailed\_System |
| 4 | >= |
| 5 | 1 |
| 6 | 15 minutes |
| 7 | 1 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
af20ad6679a8-0 | 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 | NetworkOut |
| 4 | <= |
| 5 | 100,000 bytes |
| 6 | 5 minutes |
| 7 | 1 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/UsingAlarmActions.md |
f11a207136cf-0 | The yum package manager is a great tool for installing software, because it can search all of your enabled repositories for different software packages and also handle any dependencies in the software installation process\.
**Important**
This information applies to Amazon Linux\. For information about other distributions, see their specific documentation\.
To install a package from a repository, use the yum install *package* command, replacing *package* with the name of the software to install\. For example, to install the links text\-based web browser, enter the following command\.
```
[ec2-user ~]$ sudo yum install links
```
You can also use yum install to install RPM package files that you have downloaded from the Internet\. To do this, simply append the path name of an RPM file to the installation command instead of a repository package name\.
```
[ec2-user ~]$ sudo yum install my-package.rpm
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/install-software.md |
118730a102c7-0 | Amazon EC2 Spot Instances are spare EC2 compute capacity in the AWS Cloud that are available to you at savings of up to 90% off compared to On\-Demand prices\. The only difference between On\-Demand Instances and Spot Instances is that Spot Instances can be interrupted by Amazon EC2, with two minutes of notification, when Amazon EC2 needs the capacity back\.
Spot Instances are recommended for stateless, fault\-tolerant, flexible applications\. For example, Spot Instances work well for big data, containerized workloads, CI/CD, stateless web servers, high performance computing \(HPC\), and rendering workloads\.
While running, Spot Instances are exactly the same as On\-Demand Instances\. However, Spot does not guarantee that you can keep your running instances long enough to finish your workloads\. Spot also does not guarantee that you can get immediate availability of the instances that you are looking for, or that you can always get the aggregate capacity that you requested\. Moreover, Spot Instance interruptions and capacity can change over time because Spot Instance availability varies based on supply and demand, and past performance isn’t a guarantee of future results\.
Spot Instances are not suitable for workloads that are inflexible, stateful, fault\-intolerant, or tightly coupled between instance nodes\. It's also not recommended for workloads that are intolerant of occasional periods when the target capacity is not completely available\. We strongly warn against using Spot Instances for these workloads or attempting to fail\-over to On\-Demand Instances to handle interruptions\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
118730a102c7-1 | Regardless of whether you're an experienced Spot user or new to Spot Instances, if you are currently experiencing issues with Spot Instance interruptions or availability, we recommend that you follow these best practices to have the best experience using the Spot service\.
**Topics**
+ [Prepare individual instances for interruptions](#prep-instances-for-interruptions)
+ [Be flexible about instance types and Availability Zones](#be-instance-type-flexible)
+ [Use EC2 Auto Scaling groups or Spot Fleet to manage your aggregate capacity](#use-sf-asg-for-aggregate-capacity)
+ [Use the capacity optimized allocation strategy](#use-capacity-optimized-allocation-strategy)
+ [Use integrated AWS services to manage your Spot Instances](#use-integrated-aws-services) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
0daa1ad14a57-0 | The best way for you to gracefully handle Spot Instance interruptions is to architect your application to be fault\-tolerant\. To accomplish this, you can take advantage of Spot Instance interruption notices\. A Spot Instance interruption notice is a warning that is issued two minutes before Amazon EC2 interrupts a Spot Instance\. We recommend that you create a rule in [Amazon EventBridge](https://docs.aws.amazon.com/eventbridge/index.html) that captures the interruption notification, and then triggers a checkpoint for the progress of your workload or gracefully handles the interruption\. For a detailed example that walks you through how to create and use event rules, see [Taking Advantage of Amazon EC2 Spot Instance Interruption Notices](http://aws.amazon.com/blogs/compute/taking-advantage-of-amazon-ec2-spot-instance-interruption-notices/)\.
If your workload is "time\-flexible," you can also configure your Spot Instances to be stopped or hibernated when they are interrupted\. Amazon EC2 automatically stops or hibernates your Spot Instances on interruption, and automatically resumes the instances when we have available capacity\.
For more information, see [Spot Instance interruptions](spot-interruptions.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
d837049a75c9-0 | A Spot Instance pool is a set of unused EC2 instances with the same instance type \(for example, m5\.large\) and Availability Zone \(for example, us\-east\-1a\)\. You should be flexible about which instance types you request and in which Availability Zones you can deploy your workload\. This gives Spot a better chance to find and allocate your required amount of compute capacity\. For example, don't just ask for `c5.large` if you'd be willing to use larges from the c4, m5, and m4 families\.
Depending on your specific needs, you can evaluate which instance types you can be flexible across to fulfill your compute requirements\. If a workload can be vertically scaled, you should include larger instance types \(more vCPUs and memory\) in your requests\. If you can only scale horizontally, you should include older generation instance types because they are less in demand from On\-Demand customers\.
A good rule of thumb is to be flexible across at least 10 instance types for each workload\. In addition, make sure that all Availability Zones are configured for use in your VPC and selected for your workload\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
9854c283c508-0 | Spot enables you to think in terms of aggregate capacity—in units that include vCPUs, memory, storage, or network throughput—rather than thinking in terms of individual instances\. Auto Scaling groups and Spot Fleet enable you to launch and maintain a target capacity, and to automatically request resources to replace any that are disrupted or manually terminated\. When you configure an Auto Scaling group or a Spot Fleet, you need only specify the instance types and target capacity | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
9854c283c508-1 | only specify the instance types and target capacity based on your application needs\. For more information, see [Auto Scaling Groups](https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html) in the *Amazon EC2 Auto Scaling User Guide* and [Creating a Spot Fleet request](spot-fleet-requests.md#create-spot-fleet) in this user guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
f4d8cc25eabd-0 | Allocation strategies in Auto Scaling groups help you to provision your target capacity without the need to manually look for the Spot Instance pools with spare capacity\. We recommend using the `capacity optimized` strategy because this strategy automatically provisions instances from the most\-available Spot Instance pools\. You can also take advantage of the `capacity optimized` allocation strategy in Spot Fleet\. Because your Spot Instance capacity is sourced from pools with optimal capacity, this decreases the possibility | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
f4d8cc25eabd-1 | pools with optimal capacity, this decreases the possibility that your Spot Instances are reclaimed\. For more information about allocation strategies, see [Spot Instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html#asg-spot-strategy) in the *Amazon EC2 Auto Scaling User Guide* and [Configuring Spot Fleet for capacity optimization](spot-fleet.md#spot-fleet-strategy-capacity-optimized) in this user guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
5993f87e82a1-0 | Other AWS services integrate with Spot to reduce overall compute costs without the need to manage the individual instances or fleets\. We recommend that you consider the following solutions for your applicable workloads: Amazon EMR, Amazon ECS, AWS Batch, Amazon EKS, SageMaker, AWS Elastic Beanstalk, and Amazon GameLift\. To learn more about Spot best practices with these services, see the [Amazon EC2 Spot Instances Workshops Website](https://ec2spotworkshops.com/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-best-practices.md |
2cb97324f892-0 | CloudWatch metrics are statistical data that you can use to view, analyze, and set alarms on the operational behavior of your volumes\.
The following table describes the types of monitoring data available for your Amazon EBS volumes\.
| Type | Description |
| --- | --- |
| Basic | Data is available automatically in 5\-minute periods at no charge\. This includes data for the root device volumes for EBS\-backed instances\. |
| Detailed | Provisioned IOPS SSD \(`io1` and `io2`\) volumes automatically send one\-minute metrics to CloudWatch\. |
When you get data from CloudWatch, you can include a `Period` request parameter to specify the granularity of the returned data\. This is different than the period that we use when we collect the data \(5\-minute periods\)\. We recommend that you specify a period in your request that is equal to or larger than the collection period to ensure that the returned data is valid\.
You can get the data using either the CloudWatch API or the Amazon EC2 console\. The console takes the raw data from the CloudWatch API and displays a series of graphs based on the data\. Depending on your needs, you might prefer to use either the data from the API or the graphs in the console\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
caf2e67b9f0c-0 | Amazon Elastic Block Store \(Amazon EBS\) sends data points to CloudWatch for several metrics\. Amazon EBS General Purpose SSD \(gp2\), Throughput Optimized HDD \(st1\) , Cold HDD \(sc1\), and Magnetic \(standard\) volumes automatically send five\-minute metrics to CloudWatch\. Provisioned IOPS SSD \(`io1` and `io2`\) volumes automatically send one\-minute metrics to CloudWatch\. Data is only reported to CloudWatch when the volume is attached to an instance\.
Some of these metrics have differences on Nitro\-based instances\. For a list of instance types based on the Nitro system, see [Instances built on the Nitro System](instance-types.md#ec2-nitro-instances)\.
The `AWS/EBS` namespace includes the following metrics\.
**Topics**
+ [Volume metrics](#ebs-volume-metrics)
+ [Fast snapshot restore metrics](#fast-snapshot-restore-metrics) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
2652554cae1c-0 | The `AWS/EBS` namespace includes the following metrics for EBS volumes\. To get information about the available disk space from the operating system on an instance, see [Viewing free disk space](ebs-describing-volumes.md#ebs-view-free-disk-space)\.
| Metric | Description |
| --- | --- |
| VolumeReadBytes | Provides information on the read operations in a specified period of time\. The `Sum` statistic reports the total number of bytes transferred during the period\. The `Average` statistic reports the average size of each read operation during the period, except on volumes attached to a Nitro\-based instance, where the average represents the average over the specified period\. The `SampleCount` statistic reports the total number of read operations during the period, except on volumes attached to a Nitro\-based instance, where the sample count represents the number of data points used in the statistical calculation\. For Xen instances, data is reported only when there is read activity on the volume\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Bytes | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
2652554cae1c-1 | | VolumeWriteBytes | Provides information on the write operations in a specified period of time\. The `Sum` statistic reports the total number of bytes transferred during the period\. The `Average` statistic reports the average size of each write operation during the period, except on volumes attached to a Nitro\-based instance, where the average represents the average over the specified period\. The `SampleCount` statistic reports the total number of write operations during the period, except on volumes attached to a Nitro\-based instance, where the sample count represents the number of data points used in the statistical calculation\. For Xen instances, data is reported only when there is write activity on the volume\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Bytes |
| VolumeReadOps | The total number of read operations in a specified period of time\. To calculate the average read operations per second \(read IOPS\) for the period, divide the total read operations in the period by the number of seconds in that period\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Count |
| VolumeWriteOps | The total number of write operations in a specified period of time\. To calculate the average write operations per second \(write IOPS\) for the period, divide the total write operations in the period by the number of seconds in that period\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Count | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
2652554cae1c-2 | | VolumeTotalReadTime | This metric is not supported with Multi\-Attach enabled volumes\. The total number of seconds spent by all read operations that completed in a specified period of time\. If multiple requests are submitted at the same time, this total could be greater than the length of the period\. For example, for a period of 5 minutes \(300 seconds\): if 700 operations completed during that period, and each operation took 1 second, the value would be 700 seconds\. For Xen instances, data is reported only when there is read activity on the volume\. The `Average` statistic on this metric is not relevant for volumes attached to Nitro\-based instances\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Seconds |
| VolumeTotalWriteTime | This metric is not supported with Multi\-Attach enabled volumes\. The total number of seconds spent by all write operations that completed in a specified period of time\. If multiple requests are submitted at the same time, this total could be greater than the length of the period\. For example, for a period of 5 minutes \(300 seconds\): if 700 operations completed during that period, and each operation took 1 second, the value would be 700 seconds\. For Xen instances, data is reported only when there is write activity on the volume\. The `Average` statistic on this metric is not relevant for volumes attached to Nitro\-based instances\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Seconds | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
2652554cae1c-3 | | VolumeIdleTime | This metric is not supported with Multi\-Attach enabled volumes\. The total number of seconds in a specified period of time when no read or write operations were submitted\. The `Average` statistic on this metric is not relevant for volumes attached to Nitro\-based instances\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Seconds |
| VolumeQueueLength | The number of read and write operation requests waiting to be completed in a specified period of time\. The `Sum` statistic on this metric is not relevant for volumes attached to Nitro\-based instances\. The `Minimum` and `Maximum` statistics on this metric are supported only by volumes attached to Nitro\-based instances\. Units: Count |
| VolumeThroughputPercentage | This metric is not supported with Multi\-Attach enabled volumes\. Used with Provisioned IOPS SSD volumes only\. The percentage of I/O operations per second \(IOPS\) delivered of the total IOPS provisioned for an Amazon EBS volume\. Provisioned IOPS SSD volumes deliver their provisioned performance 99\.9 percent of the time\. During a write, if there are no other pending I/O requests in a minute, the metric value will be 100 percent\. Also, a volume's I/O performance may become degraded temporarily due to an action you have taken \(for example, creating a snapshot of a volume during peak usage, running the volume on a non\-EBS\-optimized instance, or accessing data on the volume for the first time\)\. Units: Percent | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
2652554cae1c-4 | | VolumeConsumedReadWriteOps | Used with Provisioned IOPS SSD volumes only\. The total amount of read and write operations \(normalized to 256K capacity units\) consumed in a specified period of time\. I/O operations that are smaller than 256K each count as 1 consumed IOPS\. I/O operations that are larger than 256K are counted in 256K capacity units\. For example, a 1024K I/O would count as 4 consumed IOPS\. Units: Count |
| BurstBalance | Used with General Purpose SSD \(`gp2`\), Throughput Optimized HDD \(`st1`\), and Cold HDD \(`sc1`\) volumes only\. Provides information about the percentage of I/O credits \(for `gp2`\) or throughput credits \(for `st1` and `sc1`\) remaining in the burst bucket\. Data is reported to CloudWatch only when the volume is active\. If the volume is not attached, no data is reported\. The `Sum` statistic on this metric is not relevant for volumes attached to Nitro\-based instances\. If the baseline performance of the volume exceeds the maximum burst performance, credits are never spent\. If the volume is attached to a Nitro\-based instance, the burst balance is not reported\. For a non\-Nitro\-based instance, the reported burst balance is 100%\. For more information, see [I/O Credits and burst performance](ebs-volume-types.md#IOcredit)\. Units: Percent | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
46c5029b53f3-0 | `AWS/EBS` namespace includes the following metrics for [fast snapshot restore](ebs-fast-snapshot-restore.md)\.
| Metric | Description |
| --- | --- |
| FastSnapshotRestoreCreditsBucketSize | The maximum number of volume create credits that can be accumulated\. This metric is reported per snapshot per Availability Zone\. The most meaningful statistic is `Average`\. The results for the `Minimum` and `Maximum` statistics are the same as for `Average` and could be used instead\. |
| FastSnapshotRestoreCreditsBalance | The number of volume create credits available\. This metric is reported per snapshot per Availability Zone\. The most meaningful statistic is `Average`\. The results for the `Minimum` and `Maximum` statistics are the same as for `Average` and could be used instead\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
98e14b200656-0 | The supported dimension is the volume ID \(`VolumeId`\)\. All available statistics are filtered by volume ID\.
For the [volume metrics](#ebs-volume-metrics), the supported dimension is the volume ID \(`VolumeId`\)\. All available statistics are filtered by volume ID\.
For the [fast snapshot restore metrics](#fast-snapshot-restore-metrics), the supported dimensions are the snapshot ID \(`SnapshotId`\) and the Availability Zone \(`AvailabilityZone`\)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
8e19a4245831-0 | After you create a volume, you can view the volume's monitoring graphs in the Amazon EC2 console\. Select a volume on the **Volumes** page in the console and choose **Monitoring**\. The following table lists the graphs that are displayed\. The column on the right describes how the raw data metrics from the CloudWatch API are used to produce each graph\. The period for all the graphs is 5 minutes\.
| Graph | Description using raw metrics |
| --- | --- |
| Read Bandwidth \(KiB/s\) | Sum\(VolumeReadBytes\) / Period / 1024 |
| Write Bandwidth \(KiB/s\) | Sum\(VolumeWriteBytes\) / Period / 1024 |
| Read Throughput \(IOPS\) | Sum\(VolumeReadOps\) / Period |
| Write Throughput \(IOPS\) | Sum\(VolumeWriteOps\) / Period |
| Avg Queue Length \(Operations\) | Avg\(VolumeQueueLength\) |
| % Time Spent Idle | Sum\(VolumeIdleTime\) / Period × 100 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
8e19a4245831-1 | | % Time Spent Idle | Sum\(VolumeIdleTime\) / Period × 100 |
| Avg Read Size \(KiB/Operation\) | `Avg(VolumeReadBytes) / 1024` For Nitro\-based instances, the following formula derives Average Read Size using [CloudWatch Metric Math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html): `(Sum(VolumeReadBytes) / Sum(VolumeReadOps)) / 1024` The `VolumeReadBytes` and `VolumeReadOps` metrics are available in the EBS CloudWatch console\. |
| Avg Write Size \(KiB/Operation\) | `Avg(VolumeWriteBytes) / 1024` For Nitro\-based instances, the following formula derives Average Write Size using [CloudWatch Metric Math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html): `(Sum(VolumeWriteBytes) / Sum(VolumeWriteOps)) / 1024` The `VolumeWriteBytes` and `VolumeWriteOps` metrics are available in the EBS CloudWatch console\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
8e19a4245831-2 | | Avg Read Latency \(ms/Operation\) | `Avg(VolumeTotalReadTime) × 1000` For Nitro\-based instances, the following formula derives Average Read Latency using [CloudWatch Metric Math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html): `(Sum(VolumeTotalReadTime) / Sum(VolumeReadOps)) × 1000` The `VolumeTotalReadTime` and `VolumeReadOps` metrics are available in the EBS CloudWatch console\. |
| Avg Write Latency \(ms/Operation\) | `Avg(VolumeTotalWriteTime) × 1000` For Nitro\-based instances, the following formula derives Average Write Latency using [CloudWatch Metric Math](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html): `(Sum(VolumeTotalWriteTime) / Sum(VolumeWriteOps)) * 1000` The `VolumeTotalWriteTime` and `VolumeWriteOps` metrics are available in the EBS CloudWatch console\. |
For the average latency graphs and average size graphs, the average is calculated over the total number of operations \(read or write, whichever is applicable to the graph\) that completed during the period\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using_cloudwatch_ebs.md |
30410b543320-0 | Because your instance metadata is available from your running instance, you do not need to use the Amazon EC2 console or the AWS CLI\. This can be helpful when you're writing scripts to run from your instance\. For example, you can access the local IP address of your instance from instance metadata to manage a connection to an external application\.
Instance metadata is divided into categories\. For a description of each instance metadata category, see [Instance metadata categories](instancedata-data-categories.md)\.
To view all categories of instance metadata from within a running instance, use the following URI\.
```
http://169.254.169.254/latest/meta-data/
```
The IP address `169.254.169.254` is a link\-local address and is valid only from the instance\. For more information, see [Link\-local address](https://en.wikipedia.org/wiki/Link-local_address) on Wikipedia\.
Note that you are not billed for HTTP requests used to retrieve instance metadata and user data\.
The command format is different, depending on whether you use IMDSv1 or IMDSv2\. By default, you can use both instance metadata services\. To require the use of IMDSv2, see [Configuring the instance metadata service](configuring-instance-metadata-service.md)\.
You can use a tool such as cURL, as shown in the following example\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
9ae87fffa07a-0 | ```
[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" -v http://169.254.169.254/latest/meta-data/
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
2b45e54f532f-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/
```
------
You can also download the [Instance Metadata Query tool](https://aws.amazon.com/code/ec2-instance-metadata-query-tool/), which allows you to query the instance metadata using Instance Metadata Service Version 1 without having to enter the full URI or category names\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
d6f8662c4d42-0 | All instance metadata is returned as text \(HTTP content type `text/plain`\)\.
A request for a specific metadata resource returns the appropriate value, or a `404 - Not Found` HTTP error code if the resource is not available\.
A request for a general metadata resource \(the URI ends with a /\) returns a list of available resources, or a `404 - Not Found` HTTP error code if there is no such resource\. The list items are on separate lines, terminated by line feeds \(ASCII 10\)\.
For requests made using Instance Metadata Service Version 2, the following HTTP error codes can be returned:
+ `400 - Missing or Invalid Parameters` – The `PUT` request is not valid\.
+ `401 - Unauthorized` – The `GET` request uses an invalid token\. The recommended action is to generate a new token\.
+ `403 - Forbidden` – The request is not allowed or the instance metadata service is turned off\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
ca1d9798c568-0 | **Topics**
+ [Get the available versions of the instance metadata](#instance-metadata-ex-1)
+ [Get the top\-level metadata items](#instance-metadata-ex-2)
+ [Get the list of available public keys](#instance-metadata-ex-3)
+ [Show the formats in which public key 0 is available](#instance-metadata-ex-4)
+ [Get public key 0 \(in the OpenSSH key format\)](#instance-metadata-ex-5)
+ [Get the subnet ID for an instance](#instance-metadata-ex-6) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
3e1f33a25b65-0 | This example gets the available versions of the instance metadata\. These versions do not necessarily correlate with an Amazon EC2 API version\. The earlier versions are available to you in case you have scripts that rely on the structure and information present in a previous version\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
0cb7a1c5f7ef-0 | ```
[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" -v http://169.254.169.254/
1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04
2011-01-01
2011-05-01
2012-01-12
2014-02-25
2014-11-05
2015-10-20
2016-04-19
2016-06-30
2016-09-02
latest
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
73acdee97cd9-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/
1.0
2007-01-19
2007-03-01
2007-08-29
2007-10-10
2007-12-15
2008-02-01
2008-09-01
2009-04-04
2011-01-01
2011-05-01
2012-01-12
2014-02-25
2014-11-05
2015-10-20
2016-04-19
2016-06-30
2016-09-02
latest
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
726317222000-0 | This example gets the top\-level metadata items\. For more information, see [Instance metadata categories](instancedata-data-categories.md)\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
8f172767970d-0 | ```
[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" -v http://169.254.169.254/latest/meta-data/
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
events/
hostname
iam/
instance-action
instance-id
instance-life-cycle
instance-type
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-hostname
public-ipv4
public-keys/
reservation-id
security-groups
services/
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
8ac6d126bf48-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
events/
hostname
iam/
instance-action
instance-id
instance-type
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-hostname
public-ipv4
public-keys/
reservation-id
security-groups
services/
```
------
The following examples get the values of some of the top\-level metadata items that were obtained in the preceding example\. The IMDSv2 requests use the stored token that was created in the preceding example command, assuming it has not expired\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
47ac27f69e26-0 | ```
[ec2-user ~]$ curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/ami-id
ami-0abcdef1234567890
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
bc3f53973941-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/ami-id
ami-0abcdef1234567890
```
------
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
fd809a452f50-0 | ```
[ec2-user ~]$ curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/reservation-id
r-0efghijk987654321
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
1386476d0e11-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/reservation-id
r-0efghijk987654321
```
------
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
aca26db6f35f-0 | ```
[ec2-user ~]$ curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/local-hostname
ip-10-251-50-12.ec2.internal
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
dae8f80a30c1-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/local-hostname
ip-10-251-50-12.ec2.internal
```
------
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
979b58682b34-0 | ```
[ec2-user ~]$ curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/public-hostname
ec2-203-0-113-25.compute-1.amazonaws.com
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
eb15a6ce1e67-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/public-hostname
ec2-203-0-113-25.compute-1.amazonaws.com
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
a44b3ac94763-0 | This example gets the list of available public keys\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
6e3c586d07c0-0 | ```
[ec2-user ~]$ `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" -v http://169.254.169.254/latest/meta-data/public-keys/
0=my-public-key
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
6dd4d7e83f6c-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/public-keys/
0=my-public-key
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
989d3adb6247-0 | This example shows the formats in which public key 0 is available\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
f976fb7401ae-0 | ```
[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" -v http://169.254.169.254/latest/meta-data/public-keys/0/
openssh-key
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
5527243d3514-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/public-keys/0/
openssh-key
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
79c6519e2fb7-0 | This example gets public key 0 \(in the OpenSSH key format\)\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
eb508074f2e0-0 | ```
[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" -v http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
ssh-rsa MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6
b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd
BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN
MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
eb508074f2e0-1 | MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD
VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z
b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt
YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ
21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T
rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE
Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4
nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
eb508074f2e0-2 | FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb
NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE my-public-key
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
75d15d93bfff-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
ssh-rsa MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC
VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6
b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd
BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN
MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD
VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z
b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
75d15d93bfff-1 | YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ
21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T
rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE
Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4
nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb
FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb
NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE my-public-key
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
86326279cdbe-0 | This example gets the subnet ID for an instance\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
93ef24c0d3d8-0 | ```
[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" -v http://169.254.169.254/latest/meta-data/network/interfaces/macs/02:29:96:8f:6a:2d/subnet-id
subnet-be9b61d7
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
1517e6817bc3-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/02:29:96:8f:6a:2d/subnet-id
subnet-be9b61d7
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
f72a20cea9c6-0 | We throttle queries to the instance metadata service on a per\-instance basis, and we place limits on the number of simultaneous connections from an instance to the instance metadata service\.
If you're using the instance metadata service to retrieve AWS security credentials, avoid querying for credentials during every transaction or concurrently from a high number of threads or processes, as this might lead to throttling\. Instead, we recommend that you cache the credentials until they start approaching their expiry time\.
If you are throttled while accessing the instance metadata service, retry your query with an exponential backoff strategy\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
a57ccb4c3614-0 | You can consider using local firewall rules to disable access from some or all processes to the instance metadata service\.
**Using iptables to limit access**
The following example uses Linux iptables and its `owner` module to prevent the Apache webserver \(based on its default installation user ID of `apache`\) from accessing 169\.254\.169\.254\. It uses a *deny rule* to reject all instance metadata requests \(whether IMDSv1 or IMDSv2\) from any process running as that user\.
```
$ sudo iptables --append OUTPUT --proto tcp --destination 169.254.169.254 --match owner --uid-owner apache --jump REJECT
```
Or, you can consider only allowing access to particular users or groups, by using *allow rules*\. Allow rules might be easier to manage from a security perspective, because they require you to make a decision about what software needs access to instance metadata\. If you use *allow rules*, it's less likely you will accidentally allow software to access the metadata service \(that you did not intend to have access\) if you later change the software or configuration on an instance\. You can also combine group usage with allow rules, so that you can add and remove users from a permitted group without needing to change the firewall rule\.
The following example prevents access to the instance metadata service by all processes, except for processes running in the user account `trustworthy-user`\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
a57ccb4c3614-1 | The following example prevents access to the instance metadata service by all processes, except for processes running in the user account `trustworthy-user`\.
```
$ sudo iptables --append OUTPUT --proto tcp --destination 169.254.169.254 --match owner ! --uid-owner trustworthy-user --jump REJECT
```
**Note**
To use local firewall rules, you need to adapt the preceding example commands to suit your needs\.
By default, iptables rules are not persistent across system reboots\. They can be made to be persistent by using OS features, not described here\.
The iptables `owner` module only matches group membership if the group is the primary group of a given local user\. Other groups are not matched\.
**Using PF or IPFW to limit access**
If you are using FreeBSD or OpenBSD, you can also consider using PF or IPFW\. The following examples limit access to the instance metadata service to just the root user\.
**PF**
```
$ block out inet proto tcp from any to 169.254.169.254
```
```
$ pass out inet proto tcp from any to 169.254.169.254 user root
```
**IPFW**
```
$ allow tcp from any to 169.254.169.254 uid root
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
a57ccb4c3614-2 | ```
$ allow tcp from any to 169.254.169.254 uid root
```
```
$ deny tcp from any to 169.254.169.254
```
**Note**
The order of the PF and IPFW commands matter\. PF defaults to last matching rule and IPFW defaults to first matching rule\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-data-retrieval.md |
994e9f0ffd7b-0 | After you no longer need an Amazon EBS snapshot of a volume, you can delete it\. Deleting a snapshot has no effect on the volume\. Deleting a volume has no effect on the snapshots made from it\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-deleting-snapshot.md |
aa4856ef04b3-0 | If you make periodic snapshots of a volume, the snapshots are *incremental*\. This means that only the blocks on the device that have changed after your last snapshot are saved in the new snapshot\. Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to create volumes\. Data that was present on a volume, held in an earlier snapshot or series of snapshots, that is subsequently deleted from that volume at a later time, is still considered unique data of the earlier snapshots\. This unique data is not deleted from the sequence of snapshots unless all snapshots that reference the unique data are deleted\.
When you delete a snapshot, only the data referenced exclusively by that snapshot is removed\. Unique data will not be deleted unless all of the snapshots that reference that data are deleted\. Deleting previous snapshots of a volume does not affect your ability to create volumes from later snapshots of that volume\.
Deleting a snapshot might not reduce your organization's data storage costs\. Other snapshots might reference that snapshot's data, and referenced data is always preserved\. If you delete a snapshot containing data being used by a later snapshot, costs associated with the referenced data are allocated to the later snapshot\. For more information about how snapshots store data, see [How incremental snapshots work](EBSSnapshots.md#how_snapshots_work) and the following example\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-deleting-snapshot.md |
aa4856ef04b3-1 | In the following diagram, Volume 1 is shown at three points in time\. A snapshot has captured each of the first two states, and in the third, a snapshot has been deleted\.
+ In State 1, the volume has 10 GiB of data\. Because Snap A is the first snapshot taken of the volume, the entire 10 GiB of data must be copied\.
+ In State 2, the volume still contains 10 GiB of data, but 4 GiB have changed\. Snap B needs to copy and store only the 4 GiB that changed after Snap A was taken\. The other 6 GiB of unchanged data, which are already copied and stored in Snap A, are referenced by Snap B rather than \(again\) copied\. This is indicated by the dashed arrow\.
+ In state 3, the volume has not changed since State 2, but Snapshot A has been deleted\. The 6 GiB of data stored in Snapshot A that were referenced by Snapshot B have now been moved to Snapshot B, as shown by the heavy arrow\. As a result, you are still charged for storing 10 GiB of data; 6 GiB of unchanged data preserved from Snap A and 4 GiB of changed data from Snap B\.
**Deleting a snapshot with some of its data referenced by another snapshot**
![\[Snap A contains 6 GiB of referenced data. When Snap A is deleted, that data is merged into Snap B.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/snapshot_1b.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-deleting-snapshot.md |
1e798f5b05c1-0 | The following considerations apply to deleting snapshots:
+ You can't delete a snapshot of the root device of an EBS volume used by a registered AMI\. You must first deregister the AMI before you can delete the snapshot\. For more information, see [Deregistering your Linux AMI](deregister-ami.md)\.
+ You can't delete a snapshot that is managed by the AWS Backup service using Amazon EC2\. Instead, use AWS Backup to delete the corresponding recovery points in the backup vault\.
+ You can create, retain, and delete snapshots manually, or you can use Amazon Data Lifecycle Manager to manage your snapshots for you\. For more information, see [Automating snapshots](snapshot-lifecycle.md)\.
+ Although you can delete a snapshot that is still in progress, the snapshot must complete before the deletion takes effect\. This might take a long time\. If you are also at your concurrent snapshot limit, and you attempt to take an additional snapshot, you might get a `ConcurrentSnapshotLimitExceeded` error\. For more information, see the [Service Quotas](https://docs.aws.amazon.com/general/latest/gr/ebs-service.html#limits_ebs) for Amazon EBS in the *Amazon Web Services General Reference*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-deleting-snapshot.md |
Subsets and Splits