id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
3644aba8323b-1 | 1. In the navigation pane, choose **Roles**\.
1. On the **Select type of trusted entity** page, choose **AWS service**, **EC2**, **EC2 \- Spot Fleet Tagging**, **Next: Permissions**\.
1. On the **Attached permissions policy** page, choose **Next:Review**\.
1. On the **Review** page, type a name for the role \(for example, **aws\-ec2\-spot\-fleet\-tagging\-role**\) and choose **Create role**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
9c9172606475-0 | Using the AWS Management Console, quickly create a Spot Fleet request by choosing only your application or task need and minimum compute specs\. Amazon EC2 configures a fleet that best meets your needs and follows Spot best practice\. For more information, see [Quickly create a Spot Fleet request \(console\)](#create-spot-fleet-quick)\. Otherwise, you can modify any of the default settings\. For more information, see [Create a Spot Fleet request using defined parameters | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
9c9172606475-1 | [Create a Spot Fleet request using defined parameters \(console\)](#create-spot-fleet-advanced)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
75ad864f3c91-0 | Follow these steps to quickly create a Spot Fleet request\.
**To create a Spot Fleet request using the recommended settings \(console\)**
1. Open the Spot console at [https://console\.aws\.amazon\.com/ec2spot](https://console.aws.amazon.com/ec2spot)\.
1. If you are new to Spot, you see a welcome page; choose **Get started**\. Otherwise, choose **Request Spot Instances**\.
1. For **Tell us your application or task need**, choose **Load balancing workloads**, **Flexible workloads**, **Big data workloads**, or **Defined duration workloads**\.
1. Under **Configure your instances**, for **Minimum compute unit**, choose the minimum hardware specifications \(vCPUs, memory, and storage\) that you need for your application or task, either **as specs** or **as an instance type**\.
+ For **as specs**, specify the required number of vCPUs and amount of memory\.
+ For **as an instance type**, accept the default instance type, or choose **Change instance type** to choose a different instance type\.
1. Under **Tell us how much capacity you need**, for **Total target capacity**, specify the number of units to request for target capacity\. You can choose instances or vCPUs\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
75ad864f3c91-1 | 1. Review the recommended **Fleet request settings** based on your application or task selection, and choose **Launch**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-0 | You can create a Spot Fleet using the parameters that you define\.
**To create a Spot Fleet request using defined parameters \(console\)**
1. Open the Spot console at [https://console\.aws\.amazon\.com/ec2spot](https://console.aws.amazon.com/ec2spot)\.
1. If you are new to Spot, you see a welcome page; choose **Get started**\. Otherwise, choose **Request Spot Instances**\.
1. For **Tell us your application or task need**, choose **Load balancing workloads**, **Flexible workloads**, **Big data workloads**, or **Defined duration workloads**\.
1. For **Configure your instances**, do the following:
1. \(Optional\) For **Launch template**, choose a launch template\. The launch template must specify an Amazon Machine Image \(AMI\), as you cannot override the AMI using Spot Fleet if you specify a launch template\.
**Important**
If you intend to specify **Optional On\-Demand portion**, you must choose a launch template\.
1. For **AMI**, choose one of the basic AMIs provided by AWS, or choose **Search for AMI** to use an AMI from our user community, the AWS Marketplace, or one of your own\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-1 | 1. For **Minimum compute unit**, choose the minimum hardware specifications \(vCPUs, memory, and storage\) that you need for your application or task, either **as specs** or **as an instance type**\.
+ For **as specs**, specify the required number of vCPUs and amount of memory\.
+ For **as an instance type**, accept the default instance type, or choose **Change instance type** to choose a different instance type\.
1. For **Network**, choose an existing VPC or create a new one\.
\[Existing VPC\] Choose the VPC\.
\[New VPC\] Choose **Create new VPC** to go the Amazon VPC console\. When you are done, return to the wizard and refresh the list\.
1. \(Optional\) For **Availability Zone**, let AWS choose the Availability Zones for your Spot Instances, or specify one or more Availability Zones\.
If you have more than one subnet in an Availability Zone, choose the appropriate subnet from **Subnet**\. To add subnets, choose **Create new subnet** to go to the Amazon VPC console\. When you are done, return to the wizard and refresh the list\.
1. \(Optional\) For **Key pair name**, choose an existing key pair or create a new one\.
\[Existing key pair\] Choose the key pair\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-2 | \[Existing key pair\] Choose the key pair\.
\[New key pair\] Choose **Create new key pair** to go the Amazon VPC console\. When you are done, return to the wizard and refresh the list\.
1. \(Optional\) For **Additional configurations**, do the following:
1. \(Optional\) To add storage, specify additional instance store volumes or Amazon EBS volumes, depending on the instance type\.
1. \(Optional\) To enable Amazon EBS optimization, for **EBS\-optimized**, choose **Launch EBS\-optimized instances**\.
1. \(Optional\) To add temporary block\-level storage for your instances, for **Instance store**, choose **Attach at launch**\.
1. \(Optional\) By default, basic monitoring is enabled for your instances\. To enable detailed monitoring, for **Monitoring**, choose **Enable CloudWatch detailed monitoring**\.
1. \(Optional\) To replace unhealthy instances, for **Health check**, choose **Replace unhealthy instances**\. To enable this option, you must first choose **Maintain target capacity**\.
1. \(Optional\) To run a Dedicated Spot Instance, for **Tenancy**, choose **Dedicated \- run a dedicated instance**\.
1. \(Optional\) For **Security groups**, choose one or more security groups or create a new one\.
\[Existing security group\] Choose one or more security groups\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-3 | \[Existing security group\] Choose one or more security groups\.
\[New security group\] Choose **Create new security group** to go the Amazon VPC console\. When you are done, return to the wizard and refresh the list\.
1. \(Optional\) To make your instances reachable from the internet, for **Auto\-assign IPv4 Public IP**, choose **Enable**\.
1. \(Optional\) To launch your Spot Instances with an IAM role, for **IAM instance profile**, choose the role\.
1. \(Optional\) To run a start\-up script, copy it to **User data**\.
1. \(Optional\) To add a tag, choose **Add new tag** and enter the key and value for the tag\. Repeat for each tag\.
For each tag, to tag the instances and the Spot Fleet request with the same tag, ensure that both **Instance tags** and **Fleet tags** are selected\. To tag only the instances launched by the fleet, clear **Fleet tags**\. To tag only the Spot Fleet request, clear **Instance tags**\.
1. For **Tell us how much capacity you need**, do the following:
1. For **Total target capacity**, specify the number of units to request for target capacity\. You can choose instances or vCPUs\. To specify a target capacity of 0 so that you can add capacity later, choose **Maintain target capacity**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-4 | 1. \(Optional\) For **Optional On\-Demand portion**, specify the number of On\-Demand units to request\. The number must be less than the **Total target capacity**\. Amazon EC2 calculates the difference, and allocates the difference to Spot units to request\.
**Important**
To specify an optional On\-Demand portion, you must first choose a launch template\.
1. \(Optional\) By default, the Spot service terminates Spot Instances when they are interrupted\. To maintain the target capacity, choose **Maintain target capacity**\. You can then specify that the Spot service terminates, stops, or hibernates Spot Instances when they are interrupted\. To do so, choose the corresponding option from **Interruption behavior**\.
1. For **Fleet request settings**, do the following:
1. Review the fleet request and fleet allocation strategy based on your application or task selection\. To change the instance types or allocation strategy, clear **Apply recommendations**\.
1. \(Optional\) To remove instance types, for **Fleet request**, choose **Remove**\. To add instance types, choose **Select instance types**\.
1. \(Optional\) For **Fleet allocation strategy**, choose the strategy that meets your needs\. For more information, see [Allocation strategy for Spot Instances](spot-fleet.md#spot-fleet-allocation-strategy)\.
1. For **Additional request details**, do the following:
1. Review the additional request details\. To make changes, clear **Apply defaults**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-5 | 1. Review the additional request details\. To make changes, clear **Apply defaults**\.
1. \(Optional\) For **IAM fleet role**, you can use the default role or choose a different role\. To use the default role after changing the role, choose **Use default role**\.
1. \(Optional\) For **Maximum price**, you can use the default maximum price \(the On\-Demand price\) or specify the maximum price you are willing to pay\. If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances are not launched\.
1. \(Optional\) To create a request that is valid only during a specific time period, edit **Request valid from** and **Request valid until**\.
1. \(Optional\) By default, we terminate your Spot Instances when the request expires\. To keep them running after your request expires, clear **Terminate the instances when the request expires**\.
1. \(Optional\) To register your Spot Instances with a load balancer, choose **Receive traffic from one or more load balancers** and choose one or more Classic Load Balancers or target groups\.
1. \(Optional\) To download a copy of the launch configuration for use with the AWS CLI, choose **JSON config**\.
1. Choose **Launch**\.
The Spot Fleet request type is `fleet`\. When the request is fulfilled, requests of type `instance` are added, where the state is `active` and the status is `fulfilled`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
39834e4616c1-6 | **To create a Spot Fleet request using the AWS CLI**
+ Use the [request\-spot\-fleet](https://docs.aws.amazon.com/cli/latest/reference/ec2/request-spot-fleet.html) command to create a Spot Fleet request\.
```
aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json
```
For example configuration files, see [Spot Fleet example configurations](spot-fleet-examples.md)\.
The following is example output:
```
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
164d592621ba-0 | To help categorize and manage your Spot Fleet requests, you can tag them with custom metadata\. You can assign a tag to a Spot Fleet request when you create it, or afterward\. You can assign tags using the Amazon EC2 console or a command line tool\.
When you tag a Spot Fleet request, the instances and volumes that are launched by the Spot Fleet are not automatically tagged\. You need to explicitly tag the instances and volumes launched by the Spot Fleet\. You can choose to assign tags to only the Spot Fleet request, or to only the instances launched by the fleet, or to only the volumes attached to the instances launched by the fleet, or to all three\.
**Note**
Volume tags are only supported for volumes that are attached to On\-Demand Instances\. You can't tag volumes that are attached to Spot Instances\.
For more information about how tags work, see [Tagging your Amazon EC2 resources](Using_Tags.md)\.
**Topics**
+ [Prerequisite](#tag-spot-fleet-prereqs)
+ [Tagging a new Spot Fleet](#tag-new-spot-fleet)
+ [Tagging a new Spot Fleet and the instances and volumes that it launches](#tag-new-spot-fleet-and-resources)
+ [Tagging an existing Spot Fleet](#tag-existing-spot-fleet)
+ [Viewing Spot Fleet request tags](#view-spot-fleet-tags) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
dd7310af8ad5-0 | Grant the IAM user the permission to tag resources\. For more information, see [Example: Tagging resources](ExamplePolicies_EC2.md#iam-example-taggingresources)\.
**To grant an IAM user the permission to tag resources**
Create a IAM policy that includes the following:
+ The `ec2:CreateTags` action\. This grants the IAM user permission to create tags\.
+ The `ec2:RequestSpotFleet` action\. This grants the IAM user permission to create a Spot Fleet request\.
+ For `Resource`, you must specify `"*"`\. This allows users to tag all resource types\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "TagSpotFleetRequest",
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:RequestSpotFleet"
],
"Resource": "*"
}
```
**Important**
We currently do not support resource\-level permissions for the `spot-fleet-request` resource\. If you specify `spot-fleet-request` as a resource, you will get an unauthorized exception when you try to tag the fleet\. The following example illustrates how *not* to set the policy\.
```
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
dd7310af8ad5-1 | ```
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags",
"ec2:RequestSpotFleet"
],
"Resource": "arn:aws:ec2:us-east-1:111122223333:spot-fleet-request/*"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
5069a94976ab-0 | **To tag a new Spot Fleet request using the console**
1. Follow the [Create a Spot Fleet request using defined parameters \(console\)](#create-spot-fleet-advanced) procedure\.
1. To add a tag, expand **Additional configurations**, choose **Add new tag**, and enter the key and value for the tag\. Repeat for each tag\.
For each tag, you can tag the Spot Fleet request and the instances with the same tag\. To tag both, ensure that both **Instance tags** and **Fleet tags** are selected\. To tag only the Spot Fleet request, clear **Instance tags**\. To tag only the instances launched by the fleet, clear **Fleet tags**\.
1. Complete the required fields to create a Spot Fleet request, and then choose **Launch**\. For more information, see [Create a Spot Fleet request using defined parameters \(console\)](#create-spot-fleet-advanced)\.
**To tag a new Spot Fleet request using the AWS CLI**
To tag a Spot Fleet request when you create it, configure the Spot Fleet request configuration as follows:
+ Specify the tags for the Spot Fleet request in `SpotFleetRequestConfig`\.
+ For `ResourceType`, specify `spot-fleet-request`\. If you specify another value, the fleet request will fail\.
+ For `Tags`, specify the key\-value pair\. You can specify more than one key\-value pair\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
5069a94976ab-1 | + For `Tags`, specify the key\-value pair\. You can specify more than one key\-value pair\.
In the following example, the Spot Fleet request is tagged with two tags: Key=Environment and Value=Production, and Key=Cost\-Center and Value=123\.
```
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large"
}
],
"SpotPrice": "5",
"TargetCapacity": 2,
"TerminateInstancesWithExpiration": true,
"Type": "maintain",
"ReplaceUnhealthyInstances": true,
"InstanceInterruptionBehavior": "terminate",
"InstancePoolsToUseCount": 1,
"TagSpecifications": [
{
"ResourceType": "spot-fleet-request", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
5069a94976ab-2 | "TagSpecifications": [
{
"ResourceType": "spot-fleet-request",
"Tags": [
{
"Key": "Environment",
"Value":"Production"
},
{
"Key": "Cost-Center",
"Value":"123"
}
]
}
]
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
6f21c22196a3-0 | **To tag a new Spot Fleet request and the instances and volumes that it launches using the AWS CLI**
To tag a Spot Fleet request when you create it, and to tag the instances and volumes when they are launched by the fleet, configure the Spot Fleet request configuration as follows:
**Spot Fleet request tags:**
+ Specify the tags for the Spot Fleet request in `SpotFleetRequestConfig`\.
+ For `ResourceType`, specify `spot-fleet-request`\. If you specify another value, the fleet request will fail\.
+ For `Tags`, specify the key\-value pair\. You can specify more than one key\-value pair\.
**Instance tags:**
+ Specify the tags for the instances in `LaunchSpecifications`\.
+ For `ResourceType`, specify `instance`\. If you specify another value, the fleet request will fail\.
+ For `Tags`, specify the key\-value pair\. You can specify more than one key\-value pair\.
Alternatively, you can specify the tags for the instance in the [launch template](ec2-launch-templates.md#create-launch-template) that is referenced in the Spot Fleet request\.
**Volume tags:**
+ Specify the tags for the volumes in the [launch template](ec2-launch-templates.md#create-launch-template) that is referenced in the Spot Fleet request\. Volume tagging in `LaunchSpecifications` is not supported\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
6f21c22196a3-1 | In the following example, the Spot Fleet request is tagged with two tags: Key=Environment and Value=Production, and Key=Cost\-Center and Value=123\. The instances that are launched by the fleet are tagged with one tag \(which is the same as one of the tags for the Spot Fleet request\): Key=Cost\-Center and Value=123\.
```
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large",
"TagSpecifications": [
{
"ResourceType": "instance",
"Tags": [
{
"Key": "Cost-Center",
"Value": "123"
}
]
}
]
}
],
"SpotPrice": "5",
"TargetCapacity": 2,
"TerminateInstancesWithExpiration": true, | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
6f21c22196a3-2 | "TargetCapacity": 2,
"TerminateInstancesWithExpiration": true,
"Type": "maintain",
"ReplaceUnhealthyInstances": true,
"InstanceInterruptionBehavior": "terminate",
"InstancePoolsToUseCount": 1,
"TagSpecifications": [
{
"ResourceType": "spot-fleet-request",
"Tags": [
{
"Key": "Environment",
"Value":"Production"
},
{
"Key": "Cost-Center",
"Value":"123"
}
]
}
]
}
}
```
**To tag instances launched by a Spot Fleet using the AWS CLI**
To tag instances when they are launched by the fleet, you can either specify the tags in the [launch template](ec2-launch-templates.md#create-launch-template) that is referenced in the Spot Fleet request, or you can specify the tags in the Spot Fleet request configuration as follows:
+ Specify the tags for the instances in `LaunchSpecifications`\.
+ For `ResourceType`, specify `instance`\. If you specify another value, the fleet request will fail\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
6f21c22196a3-3 | + For `ResourceType`, specify `instance`\. If you specify another value, the fleet request will fail\.
+ For `Tags`, specify the key\-value pair\. You can specify more than one key\-value pair\.
In the following example, the instances that are launched by the fleet are tagged with one tag: Key=Cost\-Center and Value=123\.
```
{
"SpotFleetRequestConfig": {
"AllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "default",
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large",
"TagSpecifications": [
{
"ResourceType": "instance",
"Tags": [
{
"Key": "Cost-Center",
"Value": "123"
}
]
}
]
}
],
"SpotPrice": "5",
"TargetCapacity": 2, | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
6f21c22196a3-4 | }
],
"SpotPrice": "5",
"TargetCapacity": 2,
"TerminateInstancesWithExpiration": true,
"Type": "maintain",
"ReplaceUnhealthyInstances": true,
"InstanceInterruptionBehavior": "terminate",
"InstancePoolsToUseCount": 1
}
}
```
**To tag volumes attached to On\-Demand Instances launched by a Spot Fleet using the AWS CLI**
To tag volumes when they are created by the fleet, you must specify the tags in the [launch template](ec2-launch-templates.md#create-launch-template) that is referenced in the Spot Fleet request\.
**Note**
Volume tags are only supported for volumes that are attached to On\-Demand Instances\. You can't tag volumes that are attached to Spot Instances\.
Volume tagging in `LaunchSpecifications` is not supported\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
dbddf773beb1-0 | **To tag an existing Spot Fleet request using the console**
After you have created a Spot Fleet request, you can add tags to the fleet request using the console\.
1. Open the Spot console at [https://console\.aws\.amazon\.com/ec2spot](https://console.aws.amazon.com/ec2spot)\.
1. Select your Spot Fleet request\.
1. Choose the **Tags** tab and choose **Create Tag**\.
**To tag an existing Spot Fleet request using the AWS CLI**
You can use the [create\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html) command to tag existing resources\. In the following example, the existing Spot Fleet request is tagged with Key=purpose and Value=test\.
```
aws ec2 create-tags \
--resources sfr-11112222-3333-4444-5555-66666EXAMPLE \
--tags Key=purpose,Value=test
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
383d4b61a6cb-0 | **To view Spot Fleet request tags using the console**
1. Open the Spot console at [https://console\.aws\.amazon\.com/ec2spot](https://console.aws.amazon.com/ec2spot)\.
1. Select your Spot Fleet request and choose the **Tags** tab\.
**To describe Spot Fleet request tags**
Use the [describe\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-tags.html) command to view the tags for the specified resource\. In the following example, you describe the tags for the specified Spot Fleet request\.
```
aws ec2 describe-tags \
--filters "Name=resource-id,Values=sfr-11112222-3333-4444-5555-66666EXAMPLE"
```
```
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "sfr-11112222-3333-4444-5555-66666EXAMPLE",
"ResourceType": "spot-fleet-request",
"Value": "Production"
},
{
"Key": "Another key", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
383d4b61a6cb-1 | "Value": "Production"
},
{
"Key": "Another key",
"ResourceId": "sfr-11112222-3333-4444-5555-66666EXAMPLE",
"ResourceType": "spot-fleet-request",
"Value": "Another value"
}
]
}
```
You can also view the tags of a Spot Fleet request by describing the Spot Fleet request\.
Use the [describe\-spot\-fleet\-requests](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-spot-fleet-requests.html) command to view the configuration of the specified Spot Fleet request, which includes any tags that were specified for the fleet request\.
```
aws ec2 describe-spot-fleet-requests \
--spot-fleet-request-ids sfr-11112222-3333-4444-5555-66666EXAMPLE
```
```
{
"SpotFleetRequestConfigs": [
{
"ActivityStatus": "fulfilled",
"CreateTime": "2020-02-13T02:49:19.709Z",
"SpotFleetRequestConfig": {
"AllocationStrategy": "capacityOptimized", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
383d4b61a6cb-2 | "SpotFleetRequestConfig": {
"AllocationStrategy": "capacityOptimized",
"OnDemandAllocationStrategy": "lowestPrice",
"ExcessCapacityTerminationPolicy": "Default",
"FulfilledCapacity": 2.0,
"OnDemandFulfilledCapacity": 0.0,
"IamFleetRole": "arn:aws:iam::111122223333:role/aws-ec2-spot-fleet-tagging-role",
"LaunchSpecifications": [
{
"ImageId": "ami-0123456789EXAMPLE",
"InstanceType": "c4.large"
}
],
"TargetCapacity": 2,
"OnDemandTargetCapacity": 0,
"Type": "maintain",
"ReplaceUnhealthyInstances": false,
"InstanceInterruptionBehavior": "terminate"
},
"SpotFleetRequestId": "sfr-11112222-3333-4444-5555-66666EXAMPLE",
"SpotFleetRequestState": "active",
"Tags": [
{
"Key": "Environment", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
383d4b61a6cb-3 | "Tags": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Another key",
"Value": "Another value"
}
]
}
]
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
605035d2d4fe-0 | The Spot Fleet launches Spot Instances when your maximum price exceeds the Spot price and capacity is available\. The Spot Instances run until they are interrupted or you terminate them\.
**To monitor your Spot Fleet \(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 **Spot Requests**\.
1. Select your Spot Fleet request\. To see the configuration details, choose **Description**\.
1. To list the Spot Instances for the Spot Fleet, choose **Instances**\.
1. To view the history for the Spot Fleet, choose **History**\.
**To monitor your Spot Fleet \(AWS CLI\)**
Use the [describe\-spot\-fleet\-requests](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-spot-fleet-requests.html) command to describe your Spot Fleet requests\.
```
aws ec2 describe-spot-fleet-requests
```
Use the [describe\-spot\-fleet\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-spot-fleet-instances.html) command to describe the Spot Instances for the specified Spot Fleet\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
605035d2d4fe-1 | ```
aws ec2 describe-spot-fleet-instances \
--spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
```
Use the [describe\-spot\-fleet\-request\-history](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-spot-fleet-request-history.html) command to describe the history for the specified Spot Fleet request\.
```
aws ec2 describe-spot-fleet-request-history \
--spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
--start-time 2015-05-18T00:00:00Z
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
3645564021db-0 | You can modify an active Spot Fleet request to complete the following tasks:
+ Increase the target capacity and On\-Demand portion
+ Decrease the target capacity and On\-Demand portion
**Note**
You can't modify a one\-time Spot Fleet request\. You can only modify a Spot Fleet request if you selected **Maintain target capacity** when you created the Spot Fleet request\.
When you increase the target capacity, the Spot Fleet launches additional Spot Instances\. When you increase the On\-Demand portion, the Spot Fleet launches additional On\-Demand Instances\.
When you increase the target capacity, the Spot Fleet launches the additional Spot Instances according to the allocation strategy for its Spot Fleet request\. If the allocation strategy is `lowestPrice`, the Spot Fleet launches the instances from the lowest\-priced Spot Instance pool in the Spot Fleet request\. If the allocation strategy is `diversified`, the Spot Fleet distributes the instances across the pools in the Spot Fleet request\.
When you decrease the target capacity, the Spot Fleet cancels any open requests that exceed the new target capacity\. You can request that the Spot Fleet terminate Spot Instances until the size of the fleet reaches the new target capacity\. If the allocation strategy is `lowestPrice`, the Spot Fleet terminates the instances with the highest price per unit\. If the allocation strategy is `diversified`, the Spot Fleet terminates instances across the pools\. Alternatively, you can request that the Spot Fleet keep the fleet at its current size, but not replace any Spot Instances that are interrupted or that you terminate manually\.
When a Spot Fleet terminates an instance because the target capacity was decreased, the instance receives a Spot Instance interruption notice\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
3645564021db-1 | When a Spot Fleet terminates an instance because the target capacity was decreased, the instance receives a Spot Instance interruption notice\.
**To modify a Spot Fleet request \(console\)**
1. Open the Spot console at [https://console\.aws\.amazon\.com/ec2spot/home/fleet](https://console.aws.amazon.com/ec2spot/home/fleet)\.
1. Select your Spot Fleet request\.
1. Choose **Actions**, **Modify target capacity**\.
1. In **Modify target capacity**, do the following:
1. Enter the new target capacity and On\-Demand portion\.
1. \(Optional\) If you are decreasing the target capacity but want to keep the fleet at its current size, clear **Terminate instances**\.
1. Choose **Submit**\.
**To modify a Spot Fleet request using the AWS CLI**
Use the [modify\-spot\-fleet\-request](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-spot-fleet-request.html) command to update the target capacity of the specified Spot Fleet request\.
```
aws ec2 modify-spot-fleet-request \
--spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
--target-capacity 20
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
3645564021db-2 | --target-capacity 20
```
You can modify the previous command as follows to decrease the target capacity of the specified Spot Fleet without terminating any Spot Instances as a result\.
```
aws ec2 modify-spot-fleet-request \
--spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
--target-capacity 10 \
--excess-capacity-termination-policy NoTermination
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
c933f902ab8a-0 | When you are finished using your Spot Fleet, you can cancel the Spot Fleet request\. This cancels all Spot requests associated with the Spot Fleet, so that no new Spot Instances are launched for your Spot Fleet\. You must specify whether the Spot Fleet should terminate its Spot Instances\. If you terminate the instances, the Spot Fleet request enters the `cancelled_terminating` state\. Otherwise, the Spot Fleet request enters the `cancelled_running` state and the instances continue to run until they are interrupted or you terminate them manually\.
**To cancel a Spot Fleet request \(console\)**
1. Open the Spot console at [https://console\.aws\.amazon\.com/ec2spot/home/fleet](https://console.aws.amazon.com/ec2spot/home/fleet)\.
1. Select your Spot Fleet request\.
1. Choose **Actions**, **Cancel spot request**\.
1. In **Cancel spot request**, verify that you want to cancel the Spot Fleet\. To keep the fleet at its current size, clear **Terminate instances**\. When you are ready, choose **Confirm**\.
**To cancel a Spot Fleet request using the AWS CLI**
Use the [cancel\-spot\-fleet\-requests](https://docs.aws.amazon.com/cli/latest/reference/ec2/cancel-spot-fleet-requests.html) command to cancel the specified Spot Fleet request and terminate the instances\.
```
aws ec2 cancel-spot-fleet-requests \ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
c933f902ab8a-1 | ```
aws ec2 cancel-spot-fleet-requests \
--spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
--terminate-instances
```
The following is example output:
```
{
"SuccessfulFleetRequests": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"CurrentSpotFleetRequestState": "cancelled_terminating",
"PreviousSpotFleetRequestState": "active"
}
],
"UnsuccessfulFleetRequests": []
}
```
You can modify the previous command as follows to cancel the specified Spot Fleet request without terminating the instances\.
```
aws ec2 cancel-spot-fleet-requests \
--spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
--no-terminate-instances
```
The following is example output:
```
{
"SuccessfulFleetRequests": [
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
c933f902ab8a-2 | The following is example output:
```
{
"SuccessfulFleetRequests": [
{
"SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
"CurrentSpotFleetRequestState": "cancelled_running",
"PreviousSpotFleetRequestState": "active"
}
],
"UnsuccessfulFleetRequests": []
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md |
d16921a5f52d-0 | AWS Compute Optimizer provides Amazon EC2 instance recommendations to help you improve performance, save money, or both\. You can use these recommendations to decide whether to move to a new instance type\.
To make recommendations, Compute Optimizer analyzes your existing instance specifications and utilization metrics\. The compiled data is then used to recommend which Amazon EC2 instance types are best able to handle the existing workload\. Recommendations are returned along with per\-hour instance pricing\.
This topic outlines how to view recommendations through the Amazon EC2 console\. For more information, see the [AWS Compute Optimizer User Guide](https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-dashboard.html)\.
**Note**
To get recommendations from Compute Optimizer, you must first opt in to Compute Optimizer\. For more information, see [Getting Started with AWS Compute Optimizer](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html) in the *AWS Compute Optimizer User Guide*\.
**Topics**
+ [Limitations](#compute-optimizer-limitations)
+ [Findings](#findings-classifications)
+ [Viewing recommendations](#viewing-recommendations)
+ [Considerations for evaluating recommendations](#considerations) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
35c06959b906-0 | Compute Optimizer currently generates recommendations for M, C, R, T, and X instance types\. Other instance types are not considered by Compute Optimizer\. If you're using other instance types, they will not be listed in the Compute Optimizer recommendations view\. For information about these and other instance types, see [Instance types](instance-types.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
b1535081ffdf-0 | Compute Optimizer classifies its findings for EC2 instances as follows:
+ **Under\-provisioned** – An EC2 instance is considered under\-provisioned when at least one specification of your instance, such as CPU, memory, or network, does not meet the performance requirements of your workload\. Under\-provisioned EC2 instances might lead to poor application performance\.
+ **Over\-provisioned** – An EC2 instance is considered over\-provisioned when at least one specification of your instance, such as CPU, memory, or network, can be sized down while still meeting the performance requirements of your workload, and when no specification is under\-provisioned\. Over\-provisioned EC2 instances might lead to unnecessary infrastructure cost\.
+ **Optimized** – An EC2 instance is considered optimized when all specifications of your instance, such as CPU, memory, and network, meet the performance requirements of your workload, and the instance is not over\-provisioned\. An optimized EC2 instance runs your workloads with optimal performance and infrastructure cost\. For optimized instances, Compute Optimizer might sometimes recommend a new generation instance type\.
+ **None** – There are no recommendations for this instance\. This might occur if you've been opted in to Compute Optimizer for less than 12 hours, or when the instance has been running for less than 30 hours, or when the instance type is not supported by Compute Optimizer\. For more information, see [Limitations](#compute-optimizer-limitations) in the previous section\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
95efdec92495-0 | After you opt in to Compute Optimizer, you can view the findings that Compute Optimizer generates for your EC2 instances in the EC2 console\. You can then access the Compute Optimizer console to view the recommendations\. If you recently opted in, findings might not be reflected in the EC2 console for up to 12 hours\.
**To view a recommendation for an EC2 instance through the 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 an instance, and on the **Description** tab, inspect the **Finding** field\. Choose **View detail**\.
The instance opens in Compute Optimizer, where it is labeled as the **Current** instance\. Up to three different instance type recommendations, labeled **Option 1**, **Option 2**, and **Option 3**, are provided\. The bottom half of the window shows recent CloudWatch metric data for the current instance: **CPU utilization**, **Memory utilization**, **Network in**, and **Network out**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
95efdec92495-1 | 1. \(Optional\) In the Compute Optimizer console, choose the settings \(![\[Image NOT FOUND\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/settings-icon.png)\) icon to change the visible columns in the table, or to view the public pricing information for a different purchasing option for the current and recommended instance types\.
**Note**
If you’ve purchased a Reserved Instance, your On\-Demand Instance might be billed as a Reserved Instance\. Before you change your current instance type, first evaluate the impact on Reserved Instance utilization and coverage\.
Determine whether you want to use one of the recommendations\. Decide whether to optimize for performance improvement, for cost reduction, or for a combination of the two\. For more information, see [Viewing Resource Recommendations](https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-recommendations.html) in the *AWS Compute Optimizer User Guide*\.
**To view recommendations for all EC2 instances across all Regions through the Compute Optimizer console**
1. Open the Compute Optimizer console at [https://console\.aws\.amazon\.com/compute\-optimizer/](https://console.aws.amazon.com/compute-optimizer/)\.
1. Choose **View recommendations for all EC2 instances**\.
1. You can perform the following actions on the recommendations page: | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
95efdec92495-2 | 1. Choose **View recommendations for all EC2 instances**\.
1. You can perform the following actions on the recommendations page:
1. To filter recommendations to one or more AWS Regions, enter the name of the Region in the **Filter by one or more Regions** text box, or choose one or more Regions in the drop\-down list that appears\.
1. To view recommendations for resources in another account, choose **Account**, and then select a different account ID\.
This option is available only if you are signed in to a master account of an organization, and you opted in all member accounts within the organization\.
1. To clear the selected filters, choose **Clear filters**\.
1. To change the purchasing option that is displayed for the current and recommended instance types, choose the settings \(![\[Image NOT FOUND\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/settings-icon.png)\) icon , and then choose **On\-Demand Instances**, **Reserved Instances, standard 1\-year no upfront**, or **Reserved Instances, standard 3\-year no upfront**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
95efdec92495-3 | 1. To view details, such as additional recommendations and a comparison of utilization metrics, choose the finding \(**Under\-provisioned**, **Over\-provisioned**, or **Optimized**\) listed next to the desired instance\. For more information, see [Viewing Resource Details](https://docs.aws.amazon.com/compute-optimizer/latest/ug/viewing-resource-details.html) in the *AWS Compute Optimizer User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
8f2534022d89-0 | Before changing an instance type, consider the following:
+ The recommendations don’t forecast your usage\. Recommendations are based on your historical usage over the most recent 14\-day time period\. Be sure to choose an instance type that is expected to meet your future resource needs\.
+ Focus on the graphed metrics to determine whether actual usage is lower than instance capacity\. You can also view metric data \(average, peak, percentile\) in CloudWatch to further evaluate your EC2 instance recommendations\. For example, notice how CPU percentage metrics change during the day and whether there are peaks that need to be accommodated\. For more information, see [Viewing Available Metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/viewing_metrics_with_cloudwatch.html) in the *Amazon CloudWatch User Guide*\.
+ Compute Optimizer might supply recommendations for burstable performance instances, which are T3, T3a, and T2 instances\. If you periodically burst above the baseline, make sure that you can continue to do so based on the vCPUs of the new instance type\. For more information, see [CPU credits and baseline utilization for burstable performance instances](burstable-credits-baseline-concepts.md)\.
+ If you’ve purchased a Reserved Instance, your On\-Demand Instance might be billed as a Reserved Instance\. Before you change your current instance type, first evaluate the impact on Reserved Instance utilization and coverage\.
+ Consider conversions to newer generation instances, where possible\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
8f2534022d89-1 | + Consider conversions to newer generation instances, where possible\.
+ When migrating to a different instance family, make sure the current instance type and the new instance type are compatible, for example, in terms of virtualization, architecture, or network type\. For more information, see [Compatibility for resizing instances](ec2-instance-resize.md#resize-limitations)\.
+ Finally, consider the performance risk rating that's provided for each recommendation\. Performance risk indicates the amount of effort you might need to spend in order to validate whether the recommended instance type meets the performance requirements of your workload\. We also recommend rigorous load and performance testing before and after making any changes\.
There are other considerations when resizing an EC2 instance\. For more information, see [Changing the instance type](ec2-instance-resize.md)\.
**Additional resources**
+ [Instance types](instance-types.md)
+ [AWS Compute Optimizer User Guide](https://docs.aws.amazon.com/compute-optimizer/latest/ug/) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-recommendations.md |
fa5188240de8-0 | Use the following guidelines to reduce the attack surface and improve the reliability of the AMIs you create\.
**Important**
No list of security guidelines can be exhaustive\. Build your shared AMIs carefully and take time to consider where you might expose sensitive data\.
**Topics**
+ [Update the AMI tools before using them](#public-amis-update-ami-tools)
+ [Disable password\-based remote logins for root](#public-amis-disable-password-logins-for-root)
+ [Disable local root access](#restrict-root-access)
+ [Remove SSH host key pairs](#remove-ssh-host-key-pairs)
+ [Install public key credentials](#public-amis-install-credentials)
+ [Disabling sshd DNS checks \(optional\)](#public-amis-disable-ssh-dns-lookups)
+ [Identify yourself](#public-amis-identity)
+ [Protect yourself](#public-amis-protect-yourself)
If you are building AMIs for AWS Marketplace, see [Building AMIs for AWS Marketplace](https://aws.amazon.com/marketplace/help/201231340/ref=help_ln_sibling) for guidelines, policies and best practices\.
For additional information about sharing AMIs safely, see the following articles: | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
fa5188240de8-1 | For additional information about sharing AMIs safely, see the following articles:
+ [How To Share and Use Public AMIs in A Secure Manner](https://aws.amazon.com/articles/0155828273219400)
+ [Public AMI Publishing: Hardening and Clean\-up Requirements](https://aws.amazon.com/articles/9001172542712674) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
6a4fe8f4823f-0 | For AMIs backed by instance store, we recommend that your AMIs download and upgrade the Amazon EC2 AMI creation tools before you use them\. This ensures that new AMIs based on your shared AMIs have the latest AMI tools\.
For [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2), install the `aws-amitools-ec2` package and add the AMI tools to your PATH with the following command\. For the [Amazon Linux AMI](https://aws.amazon.com/amazon-linux-ami), `aws-amitools-ec2` package is already installed by default\.
```
[ec2-user ~]$ sudo yum install -y aws-amitools-ec2 && export PATH=$PATH:/opt/aws/bin > /etc/profile.d/aws-amitools-ec2.sh && . /etc/profile.d/aws-amitools-ec2.sh
```
Upgrade the AMI tools with the following command:
```
[ec2-user ~]$ sudo yum upgrade -y aws-amitools-ec2
```
For other distributions, make sure you have the latest AMI tools\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
0ae69f686758-0 | Using a fixed root password for a public AMI is a security risk that can quickly become known\. Even relying on users to change the password after the first login opens a small window of opportunity for potential abuse\.
To solve this problem, disable password\-based remote logins for the root user\.
**To disable password\-based remote logins for root**
1. Open the `/etc/ssh/sshd_config` file with a text editor and locate the following line:
```
#PermitRootLogin yes
```
1. Change the line to:
```
PermitRootLogin without-password
```
The location of this configuration file might differ for your distribution, or if you are not running OpenSSH\. If this is the case, consult the relevant documentation\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
b567cf66aa1d-0 | When you work with shared AMIs, a best practice is to disable direct root logins\. To do this, log into your running instance and issue the following command:
```
[ec2-user ~]$ sudo passwd -l root
```
**Note**
This command does not impact the use of `sudo`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
6e289de38c7a-0 | If you plan to share an AMI derived from a public AMI, remove the existing SSH host key pairs located in `/etc/ssh`\. This forces SSH to generate new unique SSH key pairs when someone launches an instance using your AMI, improving security and reducing the likelihood of "man\-in\-the\-middle" attacks\.
Remove all of the following key files that are present on your system\.
+ ssh\_host\_dsa\_key
+ ssh\_host\_dsa\_key\.pub
+ ssh\_host\_key
+ ssh\_host\_key\.pub
+ ssh\_host\_rsa\_key
+ ssh\_host\_rsa\_key\.pub
+ ssh\_host\_ecdsa\_key
+ ssh\_host\_ecdsa\_key\.pub
+ ssh\_host\_ed25519\_key
+ ssh\_host\_ed25519\_key\.pub
You can securely remove all of these files with the following command\.
```
[ec2-user ~]$ sudo shred -u /etc/ssh/*_key /etc/ssh/*_key.pub
```
**Warning** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
6e289de38c7a-1 | ```
**Warning**
Secure deletion utilities such as **shred** may not remove all copies of a file from your storage media\. Hidden copies of files may be created by journalling file systems \(including Amazon Linux default ext4\), snapshots, backups, RAID, and temporary caching\. For more information see the **shred** [documentation](https://www.gnu.org/software/coreutils/manual/html_node/shred-invocation.html)\.
**Important**
If you forget to remove the existing SSH host key pairs from your public AMI, our routine auditing process notifies you and all customers running instances of your AMI of the potential security risk\. After a short grace period, we mark the AMI private\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
c59a2bcc80cf-0 | After configuring the AMI to prevent logging in using a password, you must make sure users can log in using another mechanism\.
Amazon EC2 allows users to specify a public\-private key pair name when launching an instance\. When a valid key pair name is provided to the `RunInstances` API call \(or through the command line API tools\), the public key \(the portion of the key pair that Amazon EC2 retains on the server after a call to `CreateKeyPair` or `ImportKeyPair`\) is made available to the instance through an HTTP query against the instance metadata\.
To log in through SSH, your AMI must retrieve the key value at boot and append it to `/root/.ssh/authorized_keys` \(or the equivalent for any other user account on the AMI\)\. Users can launch instances of your AMI with a key pair and log in without requiring a root password\.
Many distributions, including Amazon Linux and Ubuntu, use the `cloud-init` package to inject public key credentials for a configured user\. If your distribution does not support `cloud-init`, you can add the following code to a system start\-up script \(such as `/etc/rc.local`\) to pull in the public key you specified at launch for the root user\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
bb0f794ae349-0 | ```
if [ ! -d /root/.ssh ] ; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
b8002c87b465-0 | 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 > /tmp/my-key
if [ $? -eq 0 ] ; then
cat /tmp/my-key >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh/authorized_keys
rm /tmp/my-key
fi
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
77fbea326ed9-0 | ```
if [ ! -d /root/.ssh ] ; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
941b30cec5ed-0 | curl http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key > /tmp/my-key
if [ $? -eq 0 ] ; then
cat /tmp/my-key >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh/authorized_keys
rm /tmp/my-key
fi
```
------
This can be applied to any user account; you do not need to restrict it to `root`\.
**Note**
Rebundling an instance based on this AMI includes the key with which it was launched\. To prevent the key's inclusion, you must clear out \(or delete\) the `authorized_keys` file or exclude this file from rebundling\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
26b54208fdba-0 | Disabling sshd DNS checks slightly weakens your sshd security\. However, if DNS resolution fails, SSH logins still work\. If you do not disable sshd checks, DNS resolution failures prevent all logins\.
**To disable sshd DNS checks**
1. Open the `/etc/ssh/sshd_config` file with a text editor and locate the following line:
```
#UseDNS yes
```
1. Change the line to:
```
UseDNS no
```
**Note**
The location of this configuration file can differ for your distribution or if you are not running OpenSSH\. If this is the case, consult the relevant documentation\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
adc5388e1709-0 | Currently, there is no easy way to know who provided a shared AMI, because each AMI is represented by an account ID\.
We recommend that you post a description of your AMI, and the AMI ID, in the [Amazon EC2 forum](https://forums.aws.amazon.com/forum.jspa?forumID=30)\. This provides a convenient central location for users who are interested in trying new shared AMIs\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
3e67fbbdc782-0 | We recommend against storing sensitive data or software on any AMI that you share\. Users who launch a shared AMI might be able to rebundle it and register it as their own\. Follow these guidelines to help you to avoid some easily overlooked security risks:
+ We recommend using the `--exclude directory` option on `ec2-bundle-vol` to skip any directories and subdirectories that contain secret information that you would not like to include in your bundle\. In particular, exclude all user\-owned SSH public/private key pairs and SSH `authorized_keys` files when bundling the image\. The Amazon public AMIs store these in `/root/.ssh` for the root account, and `/home/user_name/.ssh/` for regular user accounts\. For more information, see [ec2\-bundle\-vol](ami-tools-commands.md#ami-bundle-vol)\.
+ Always delete the shell history before bundling\. If you attempt more than one bundle upload in the same AMI, the shell history contains your secret access key\. The following example should be the last command executed before bundling from within the instance\.
```
[ec2-user ~]$ shred -u ~/.*history
```
**Warning**
The limitations of **shred** described in the warning above apply here as well\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
3e67fbbdc782-1 | ```
**Warning**
The limitations of **shred** described in the warning above apply here as well\.
Be aware that bash writes the history of the current session to the disk on exit\. If you log out of your instance after deleting `~/.bash_history`, and then log back in, you will find that `~/.bash_history` has been re\-created and contains all of the commands executed during your previous session\.
Other programs besides bash also write histories to disk, Use caution and remove or exclude unnecessary dot\-files and dot\-directories\.
+ Bundling a running instance requires your private key and X\.509 certificate\. Put these and other credentials in a location that is not bundled \(such as the instance store\)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/building-shared-amis.md |
7bf8d0185db8-0 | Session Manager is a fully managed AWS Systems Manager capability that lets you manage your Amazon EC2 instances through an interactive one\-click browser\-based shell or through the AWS CLI\. You can use Session Manager to start a session with an instance in your account\. After the session is started, you can run bash commands as you would through any other connection type\. For more information about Session Manager, see [AWS Systems Manager Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html) in the *AWS Systems Manager User Guide*\.
Before attempting to connect to an instance using Session Manager, ensure that the necessary setup steps have been completed\. For more information and instructions, see [ Getting Started with Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html)\.
**To connect to a Linux instance using Session Manager 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 **Connect**\.
1. For **Connection method**, choose **Session Manager**\.
1. Choose **Connect**\.
**Troubleshooting** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/session-manager.md |
7bf8d0185db8-1 | 1. Choose **Connect**\.
**Troubleshooting**
If you receive an error that you’re not authorized to perform one or more Systems Manager actions \(`ssm:command-name`\), then you must update your policies to allow you to start sessions from the Amazon EC2 console\. For more information, see [ Quickstart Default IAM Policies for Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-restrict-access-quickstart.html) in the *AWS Systems Manager User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/session-manager.md |
609a0dbb82df-0 | A consistent and accurate time reference is crucial for many server tasks and processes\. Most system logs include a time stamp that you can use to determine when problems occur and in what order the events take place\. If you use the AWS CLI or an AWS SDK to make requests from your instance, these tools sign requests on your behalf\. If your instance's date and time are not set correctly, the date in the signature may not match the date of the request, and AWS rejects the request\.
Amazon provides the Amazon Time Sync Service, which is accessible from all EC2 instances, and is also used by other AWS services\. This service uses a fleet of satellite\-connected and atomic reference clocks in each Region to deliver accurate current time readings of the Coordinated Universal Time \(UTC\) global standard through Network Time Protocol \(NTP\)\. The Amazon Time Sync Service automatically smooths any leap seconds that are added to UTC\.
The Amazon Time Sync Service is available through NTP at the `169.254.169.123` IP address for any instance running in a VPC\. Your instance does not require access to the internet, and you do not have to configure your security group rules or your network ACL rules to allow access\. The latest versions of Amazon Linux 2 and Amazon Linux AMIs synchronize with the Amazon Time Sync Service by default\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
609a0dbb82df-1 | Use the following procedures to configure the Amazon Time Sync Service on your instance using the `chrony` client\. Alternatively, you can use external NTP sources\. For more information about NTP and public time sources, see [http://www\.ntp\.org/](http://www.ntp.org/)\. An instance needs access to the internet for the external NTP time sources to work\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
ccf68990f4ed-0 | **Note**
On Amazon Linux 2, the default `chrony` configuration is already set up to use the Amazon Time Sync Service IP address\.
With the Amazon Linux AMI, you must edit the `chrony` configuration file to add a server entry for the Amazon Time Sync Service\.
**To configure your instance to use the Amazon Time Sync Service**
1. Connect to your instance and uninstall the NTP service\.
```
[ec2-user ~]$ sudo yum erase 'ntp*'
```
1. Install the `chrony` package\.
```
[ec2-user ~]$ sudo yum install chrony
```
1. Open the `/etc/chrony.conf` file using a text editor \(such as vim or nano\)\. Verify that the file includes the following line:
```
server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4
```
If the line is present, then the Amazon Time Sync Service is already configured and you can go to the next step\. If not, add the line after any other `server` or `pool` statements that are already present in the file, and save your changes\.
1. Restart the `chrony` daemon \(`chronyd`\)\.
```
[ec2-user ~]$ sudo service chronyd restart | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
ccf68990f4ed-1 | ```
[ec2-user ~]$ sudo service chronyd restart
```
```
Starting chronyd: [ OK ]
```
**Note**
On RHEL and CentOS \(up to version 6\), the service name is `chrony` instead of `chronyd`\.
1. Use the `chkconfig` command to configure `chronyd` to start at each system boot\.
```
[ec2-user ~]$ sudo chkconfig chronyd on
```
1. Verify that `chrony` is using the `169.254.169.123` IP address to synchronize the time\.
```
[ec2-user ~]$ chronyc sources -v
```
```
210 Number of sources = 7
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset, | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
ccf68990f4ed-2 | || Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 169.254.169.123 3 6 17 43 -30us[ -226us] +/- 287us
^- ec2-12-34-231-12.eu-west> 2 6 17 43 -388us[ -388us] +/- 11ms
^- tshirt.heanet.ie 1 6 17 44 +178us[ +25us] +/- 1959us
^? tbag.heanet.ie 0 6 0 - +0ns[ +0ns] +/- 0ns
^? bray.walcz.net 0 6 0 - +0ns[ +0ns] +/- 0ns
^? 2a05:d018:c43:e312:ce77:> 0 6 0 - +0ns[ +0ns] +/- 0ns | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
ccf68990f4ed-3 | ^? 2a05:d018:dab:2701:b70:b> 0 6 0 - +0ns[ +0ns] +/- 0ns
```
In the output that's returned, `^*` indicates the preferred time source\.
1. Verify the time synchronization metrics that are reported by `chrony`\.
```
[ec2-user ~]$ chronyc tracking
```
```
Reference ID : A9FEA97B (169.254.169.123)
Stratum : 4
Ref time (UTC) : Wed Nov 22 13:18:34 2017
System time : 0.000000626 seconds slow of NTP time
Last offset : +0.002852759 seconds
RMS offset : 0.002852759 seconds
Frequency : 1.187 ppm fast
Residual freq : +0.020 ppm
Skew : 24.388 ppm
Root delay : 0.000504752 seconds
Root dispersion : 0.001112565 seconds
Update interval : 64.4 seconds
Leap status : Normal
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
430d49200372-0 | You must edit the `chrony` configuration file to add a server entry for the Amazon Time Sync Service\.
**To configure your instance to use the Amazon Time Sync Service**
1. Connect to your instance and use `apt` to install the `chrony` package\.
```
ubuntu:~$ sudo apt install chrony
```
**Note**
If necessary, update your instance first by running `sudo apt update`\.
1. Open the `/etc/chrony/chrony.conf` file using a text editor \(such as vim or nano\)\. Add the following line before any other `server` or `pool` statements that are already present in the file, and save your changes:
```
server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4
```
1. Restart the `chrony` service\.
```
ubuntu:~$ sudo /etc/init.d/chrony restart
```
```
[ ok ] Restarting chrony (via systemctl): chrony.service.
```
1. Verify that `chrony` is using the `169.254.169.123` IP address to synchronize the time\.
```
ubuntu:~$ chronyc sources -v | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
430d49200372-1 | ```
ubuntu:~$ chronyc sources -v
```
```
210 Number of sources = 7
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 169.254.169.123 3 6 17 12 +15us[ +57us] +/- 320us
^- tbag.heanet.ie 1 6 17 13 -3488us[-3446us] +/- 1779us | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
430d49200372-2 | ^- tbag.heanet.ie 1 6 17 13 -3488us[-3446us] +/- 1779us
^- ec2-12-34-231-12.eu-west- 2 6 17 13 +893us[ +935us] +/- 7710us
^? 2a05:d018:c43:e312:ce77:6 0 6 0 10y +0ns[ +0ns] +/- 0ns
^? 2a05:d018:d34:9000:d8c6:5 0 6 0 10y +0ns[ +0ns] +/- 0ns
^? tshirt.heanet.ie 0 6 0 10y +0ns[ +0ns] +/- 0ns
^? bray.walcz.net 0 6 0 10y +0ns[ +0ns] +/- 0ns
```
In the output that's returned, `^*` indicates the preferred time source\.
1. Verify the time synchronization metrics that are reported by `chrony`\.
```
ubuntu:~$ chronyc tracking
```
```
Reference ID : 169.254.169.123 (169.254.169.123)
Stratum : 4
Ref time (UTC) : Wed Nov 29 07:41:57 2017
System time : 0.000000011 seconds slow of NTP time | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
430d49200372-3 | Ref time (UTC) : Wed Nov 29 07:41:57 2017
System time : 0.000000011 seconds slow of NTP time
Last offset : +0.000041659 seconds
RMS offset : 0.000041659 seconds
Frequency : 10.141 ppm slow
Residual freq : +7.557 ppm
Skew : 2.329 ppm
Root delay : 0.000544 seconds
Root dispersion : 0.000631 seconds
Update interval : 2.0 seconds
Leap status : Normal
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
f12c2c2eb331-0 | Install chrony from [https://software\.opensuse\.org/package/chrony](https://software.opensuse.org/package/chrony)\.
Open the `/etc/chrony.conf` file using a text editor \(such as vim or nano\)\. Verify that the file contains the following line:
```
server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4
```
If this line is not present, add it\. Comment out any other server or pool lines\. Open yast and enable the chrony service\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
0de4af6de6cb-0 | Amazon Linux instances are set to the UTC \(Coordinated Universal Time\) time zone by default\. You can change the time on an instance to the local time or to another time zone in your network\.
**Important**
This information applies to Amazon Linux\. For information about other distributions, see their specific documentation\.
**To change the time zone on an instance**
1. Identify the time zone to use on the instance\. The `/usr/share/zoneinfo` directory contains a hierarchy of time zone data files\. Browse the directory structure at that location to find a file for your time zone\.
```
[ec2-user ~]$ ls /usr/share/zoneinfo
Africa Chile GB Indian Mideast posixrules US
America CST6CDT GB-Eire Iran MST PRC UTC
Antarctica Cuba GMT iso3166.tab MST7MDT PST8PDT WET
Arctic EET GMT0 Israel Navajo right W-SU
...
```
Some of the entries at this location are directories \(such as `America`\), and these directories contain time zone files for specific cities\. Find your city \(or a city in your time zone\) to use for the instance\.
1. Update the `/etc/sysconfig/clock` file with the new time zone\. In this example, we use the time zone data file for Los Angeles, `/usr/share/zoneinfo/America/Los_Angeles`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
0de4af6de6cb-1 | 1. Open the `/etc/sysconfig/clock` file with your favorite text editor \(such as vim or nano\)\. You need to use sudo with your editor command because `/etc/sysconfig/clock` is owned by `root`\.
```
[ec2-user ~]$ sudo nano /etc/sysconfig/clock
```
1. Locate the `ZONE` entry, and change it to the time zone file \(omitting the `/usr/share/zoneinfo` section of the path\)\. For example, to change to the Los Angeles time zone, change the `ZONE` entry to the following:
```
ZONE="America/Los_Angeles"
```
**Note**
Do not change the `UTC=true` entry to another value\. This entry is for the hardware clock, and does not need to be adjusted when you're setting a different time zone on your instance\.
1. Save the file and exit the text editor\.
1. Create a symbolic link between `/etc/localtime` and the time zone file so that the instance finds the time zone file when it references local time information\.
```
[ec2-user ~]$ sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
```
1. Reboot the system to pick up the new time zone information in all services and applications\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
0de4af6de6cb-2 | ```
1. Reboot the system to pick up the new time zone information in all services and applications\.
```
[ec2-user ~]$ sudo reboot
```
1. \(Optional\) Confirm that the current time zone is updated to the new time zone by using the date command\. The current time zone appears in the output\. In the following example, the current time zone is PDT, which refers to the Los Angeles time zone\.
```
[ec2-user ~]$ date
Sun Aug 16 05:45:16 PDT 2020
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/set-time.md |
7fc214b59d6a-0 | Amazon EC2 provides Amazon CloudWatch metrics that you can use to monitor your Spot Fleet\.
**Important**
To ensure accuracy, we recommend that you enable detailed monitoring when using these metrics\. For more information, see [Enable or disable detailed monitoring for your instances](using-cloudwatch-new.md)\.
For more information about CloudWatch metrics provided by Amazon EC2, see [Monitoring your instances using CloudWatch](using-cloudwatch.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-cloudwatch-metrics.md |
d9bc87122fbe-0 | The `AWS/EC2Spot` namespace includes the following metrics, plus the CloudWatch metrics for the Spot Instances in your fleet\. For more information, see [Instance metrics](viewing_metrics_with_cloudwatch.md#ec2-cloudwatch-metrics)\.
| Metric | Description |
| --- | --- |
| AvailableInstancePoolsCount | The Spot Instance pools specified in the Spot Fleet request\. Units: Count |
| BidsSubmittedForCapacity | The capacity for which Amazon EC2 has submitted Spot Fleet requests\. Units: Count |
| EligibleInstancePoolCount | The Spot Instance pools specified in the Spot Fleet request where Amazon EC2 can fulfill requests\. Amazon EC2 does not fulfill requests in pools where the maximum price you're willing to pay for Spot Instances is less than the Spot price or the Spot price is greater than the price for On\-Demand Instances\. Units: Count |
| FulfilledCapacity | The capacity that Amazon EC2 has fulfilled\. Units: Count |
| MaxPercentCapacityAllocation | The maximum value of `PercentCapacityAllocation` across all Spot Fleet pools specified in the Spot Fleet request\. Units: Percent |
| PendingCapacity | The difference between `TargetCapacity` and `FulfilledCapacity`\. Units: Count |
| PercentCapacityAllocation | The capacity allocated for the Spot Instance pool for the specified dimensions\. To get the maximum value recorded across all Spot Instance pools, use `MaxPercentCapacityAllocation`\. Units: Percent | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-cloudwatch-metrics.md |
d9bc87122fbe-1 | | TargetCapacity | The target capacity of the Spot Fleet request\. Units: Count |
| TerminatingCapacity | The capacity that is being terminated because the provisioned capacity is greater than the target capacity\. Units: Count |
If the unit of measure for a metric is `Count`, the most useful statistic is `Average`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-cloudwatch-metrics.md |
3b32f6a6667b-0 | To filter the data for your Spot Fleet, use the following dimensions\.
| Dimensions | Description |
| --- | --- |
| AvailabilityZone | Filter the data by Availability Zone\. |
| FleetRequestId | Filter the data by Spot Fleet request\. |
| InstanceType | Filter the data by instance type\. | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-cloudwatch-metrics.md |
880cc4ca50ed-0 | You can view the CloudWatch metrics for your Spot Fleet using the Amazon CloudWatch console\. These metrics are displayed as monitoring graphs\. These graphs show data points if the Spot Fleet is active\.
Metrics are grouped first by namespace, and then by the various combinations of dimensions within each namespace\. For example, you can view all Spot Fleet metrics or Spot Fleet metrics groups by Spot Fleet request ID, instance type, or Availability Zone\.
**To view Spot Fleet metrics**
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 Spot** namespace\.
**Note**
If the **EC2 Spot** namespace is not displayed, there are two reasons for this\. Either you've not yet used Spot Fleet—only the AWS services that you're using send metrics to Amazon CloudWatch\. Or, if you’ve not used Spot Fleet for the past two weeks, the namespace does not appear\.
1. \(Optional\) To filter the metrics by dimension, select one of the following:
+ **Fleet Request Metrics** – Group by Spot Fleet request
+ **By Availability Zone** – Group by Spot Fleet request and Availability Zone
+ **By Instance Type** – Group by Spot Fleet request and instance type | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-cloudwatch-metrics.md |
880cc4ca50ed-1 | + **By Availability Zone** – Group by Spot Fleet request and Availability Zone
+ **By Instance Type** – Group by Spot Fleet request and instance type
+ **By Availability Zone/Instance Type** – Group by Spot Fleet request, Availability Zone, and instance type
1. To view the data for a metric, select the check box next to the metric\.
![\[CloudWatch metrics for Spot Fleet\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/metric_spot_fleet.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-cloudwatch-metrics.md |
4c750b285f14-0 | By default, IAM users don't have permission to create or modify Amazon EC2 resources, or perform tasks using the Amazon EC2 API\. \(This means that they also can't do so using the Amazon EC2 console or CLI\.\) To allow IAM users to create or modify resources and perform tasks, you must create IAM policies that grant IAM users permission to use the specific resources and API actions they'll need, and then attach those policies to the IAM users or groups that require those permissions\.
When you attach a policy to a user or group of users, it allows or denies the users permission to perform the specified tasks on the specified resources\. For more general information about IAM policies, see [Permissions and Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/PermissionsAndPolicies.html) in the *IAM User Guide*\. For more information about managing and creating custom IAM policies, see [Managing IAM Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingPolicies.html)\.
**Getting Started**
An IAM policy must grant or deny permissions to use one or more Amazon EC2 actions\. It must also specify the resources that can be used with the action, which can be all resources, or in some cases, specific resources\. The policy can also include conditions that you apply to the resource\.
Amazon EC2 partially supports resource\-level permissions\. This means that for some EC2 API actions, you cannot specify which resource a user is allowed to work with for that action\. Instead, you have to allow users to work with all resources for that action\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/iam-policies-for-amazon-ec2.md |
4c750b285f14-1 | | Task | Topic |
| --- | --- |
| Understand the basic structure of a policy | [Policy syntax](iam-policy-structure.md#policy-syntax) |
| Define actions in your policy | [Actions for Amazon EC2](iam-policy-structure.md#UsingWithEC2_Actions) |
| Define specific resources in your policy | [Amazon Resource Names \(ARNs\) for Amazon EC2](iam-policy-structure.md#EC2_ARN_Format) |
| Apply conditions to the use of the resources | [Condition keys for Amazon EC2](iam-policy-structure.md#amazon-ec2-keys) |
| Work with the available resource\-level permissions for Amazon EC2 | [Actions, Resources, and Condition Keys for Amazon EC2](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonec2.html) \(IAM User Guide\) |
| Test your policy | [Checking that users have the required permissions](iam-policy-structure.md#check-required-permissions) |
| Example policies for a CLI or SDK | [Example policies for working with the AWS CLI or an AWS SDK](ExamplePolicies_EC2.md) |
| Example policies for the Amazon EC2 console | [Example policies for working in the Amazon EC2 console](iam-policies-ec2-console.md) | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/iam-policies-for-amazon-ec2.md |
b6efa479c115-0 | Host recovery automatically restarts your instances on to a new replacement host if failures are detected on your Dedicated Host\. Host recovery reduces the need for manual intervention and lowers the operational burden if there is an unexpected Dedicated Host failure\.
Additionally, built\-in integration with AWS License Manager automates the tracking and management of your licenses if a host recovery occurs\.
**Note**
AWS License Manager integration is supported only in Regions in which AWS License Manager is available\.
**Topics**
+ [Host recovery basics](#dedicated-hosts-recovery-basics)
+ [Supported instance types](#dedicated-hosts-recovery-instances)
+ [Configuring host recovery](#dedicated-hosts-recovery-working)
+ [Host recovery states](#dedicated-hosts-recovery-states)
+ [Manually recovering unsupported instances](#dedicated-hosts-recovery-unsupported)
+ [Related services](#dedicated-hosts-recovery-related)
+ [Pricing](#dedicated-hosts-recovery-pricing) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
35192a1f505d-0 | Host recovery uses host\-level health checks to assess Dedicated Host availability and to detect underlying system failures\. Examples of problems that can cause host\-level health checks to fail include:
+ Loss of network connectivity
+ Loss of system power
+ Hardware or software issues on the physical host
When a system failure is detected on your Dedicated Host, host recovery is initiated and Amazon EC2 **automatically allocates a replacement Dedicated Host**\. The replacement Dedicated Host receives a new host ID, but retains the same attributes as the original Dedicated Host, including:
+ Availability Zone
+ Instance type
+ Tags
+ Auto placement settings
After the replacement Dedicated Host is allocated, the **instances are recovered on to the replacement Dedicated Host**\. The recovered instances retain the same attributes as the original instances, including:
+ Instance ID
+ Private IP addresses
+ Elastic IP addresses
+ EBS volume attachments
+ All instance metadata
If instances have a host affinity relationship with the impaired Dedicated Host, the recovered instances establish host affinity with the replacement Dedicated Host\.
When all of the instances have been recovered on to the replacement Dedicated Host, **the impaired Dedicated Host is released**, and the replacement Dedicated Host becomes available for use\.
When host recovery is initiated, the AWS account owner is notified by email and by an AWS Personal Health Dashboard event\. A second notification is sent after the host recovery has been successfully completed\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
35192a1f505d-1 | **Stopped instances are not recovered** on to the replacement Dedicated Host\. If you attempt to start a stopped instance that targets the impaired Dedicated Host, the instance start fails\. We recommend that you modify the stopped instance to either target a different Dedicated Host, or to launch on any available Dedicated Host with matching configurations and auto\-placement enabled\.
**Instances with instance storage are not recovered** on to the replacement Dedicated Host\. As a remedial measure, the impaired Dedicated Host is marked for retirement and you receive a retirement notification after the host recovery is complete\. Follow the remedial steps described in the retirement notification within the specified time period to manually recover the remaining instances on the impaired Dedicated Host\.
If you are using AWS License Manager to track your licenses, AWS License Manager allocates new licenses for the replacement Dedicated Host based on the license configuration limits\. If the license configuration has hard limits that will be breached as a result of the host recovery, the recovery process is not allowed and you are notified of the host recovery failure through an Amazon SNS notification\. If the license configuration has soft limits that will be breached as a result of the host recovery, the recovery is allowed to continue and you are notified of the limit breach through an Amazon SNS notification\. For more information, see [Using License Configurations](https://docs.aws.amazon.com/license-manager/latest/userguide/license-configurations.html) in the *AWS License Manager User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
d3afb16bc95b-0 | Host recovery is supported for the following instance families: A1, C3, C4, C5, C5n, C6g, Inf1, M3, M4, M5, M5n, M6g, P3, R3, R4, R5, R5n, R6g, X1, X1e, u\-6tb1, u\-9tb1, u\-12tb1, u\-18tb1, and u\-24tb1\.
To recover instances that are not supported, see [Manually recovering unsupported instances](#dedicated-hosts-recovery-unsupported)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
f532a5bca497-0 | You can configure host recovery at the time of Dedicated Host allocation, or after allocation using the Amazon EC2 console or AWS Command Line Interface \(CLI\)\.
**Topics**
+ [Enabling host recovery](#dedicated-hosts-recovery-enable)
+ [Disabling host recovery](#dedicated-hosts-recovery-disable)
+ [Viewing the host recovery configuration](#dedicated-hosts-recovery-view) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
76be7bb8549c-0 | You can enable host recovery at the time of Dedicated Host allocation or after allocation\.
For more information about enabling host recovery at the time of Dedicated Host allocation, see [Allocating Dedicated Hosts](how-dedicated-hosts-work.md#dedicated-hosts-allocating)\.
**To enable host recovery after allocation using the 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 **Dedicated Hosts**\.
1. Select the Dedicated Host for which to enable host recovery, and then choose **Actions**, **Modify Host Recovery**\.
1. For **Host recovery**, choose **Enable**, and then choose **Save**\.
**To enable host recovery after allocation using the AWS CLI**
Use the [modify\-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-hosts.html) command and specify the `host-recovery` parameter\.
```
$ aws ec2 modify-hosts --host-recovery on --host-ids h-012a3456b7890cdef
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
8c251fddb889-0 | You can disable host recovery at any time after the Dedicated Host has been allocated\.
**To disable host recovery after allocation using the 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 **Dedicated Hosts**\.
1. Select the Dedicated Host for which to disable host recovery, and then choose **Actions**, **Modify Host Recovery**\.
1. For **Host recovery**, choose **Disable**, and then choose **Save**\.
**To disable host recovery after allocation using the AWS CLI**
Use the [modify\-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-hosts.html) command and specify the `host-recovery` parameter\.
```
$ aws ec2 modify-hosts --host-recovery off --host-ids h-012a3456b7890cdef
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
a881a67c8c93-0 | You can view the host recovery configuration for a Dedicated Host at any time\.
**To view the host recovery configuration for a Dedicated Host using the 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 **Dedicated Hosts**\.
1. Select the Dedicated Host, and in the **Description** tab, review the **Host Recovery** field\.
**To view the host recovery configuration for a Dedicated Host using the AWS CLI**
Use the [describe\-hosts](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-hosts.html) command\.
```
$ aws ec2 describe-hosts --host-ids h-012a3456b7890cdef
```
The `HostRecovery` response element indicates whether host recovery is enabled or disabled\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
cf55058b3225-0 | When a Dedicated Host failure is detected, the impaired Dedicated Host enters the `under-assessment` state, and all of the instances enter the `impaired` state\. You can't launch instances on to the impaired Dedicated Host while it is in the `under-assessment` state\.
After the replacement Dedicated Host is allocated, it enters the `pending` state\. It remains in this state until the host recovery process is complete\. You can't launch instances on to the replacement Dedicated Host while it is in the `pending` state\. Recovered instances on the replacement Dedicated Host remain in the `impaired` state during the recovery process\.
After the host recovery is complete, the replacement Dedicated Host enters the `available` state, and the recovered instances return to the `running` state\. You can launch instances on to the replacement Dedicated Host after it enters the `available` state\. The original impaired Dedicated Host is permanently released and it enters the `released-permanent-failure` state\.
If the impaired Dedicated Host has instances that do not support host recovery, such as instances with instance store\-backed volumes, the Dedicated Host is not released\. Instead, it is marked for retirement and enters the `permanent-failure` state\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
d02f8d99032d-0 | Host recovery does not support recovering instances that use instance store volumes\. Follow the instructions below to manually recover any of your instances that could not be automatically recovered\.
**Warning**
Data on instance store volumes is lost when an instance is stopped or terminated\. This includes instance store volumes that are attached to an instance that has an EBS volume as the root device\. To protect data from instance store volumes, back it up to persistent storage before the instance is stopped or terminated\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
04a15110b802-0 | For EBS\-backed instances that could not be automatically recovered, we recommend that you manually stop and start the instances to recover them onto a new Dedicated Host\. For more information about stopping your instance, and about the changes that occur in your instance configuration when it's stopped, see [Stop and start your instance](Stop_Start.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
1daa060a257f-0 | For instance store\-backed instances that could not be automatically recovered, we recommend that you do the following:
1. Launch a replacement instance on a new Dedicated Host from your most recent AMI\.
1. Migrate all of the necessary data to the replacement instance\.
1. Terminate the original instance on the impaired Dedicated Host\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
43cf1d68291f-0 | Dedicated Host integrates with the following AWS services:
+ **AWS License Manager**—Tracks licenses across your Amazon EC2 Dedicated Hosts \(supported only in Regions in which AWS License Manager is available\)\. For more information, see the [ AWS License Manager User Guide](https://docs.aws.amazon.com/license-manager/latest/userguide/license-manager.html)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
a9d12eae9edf-0 | There are no additional charges for using host recovery, but the usual Dedicated Host charges apply\. For more information, see [ Amazon EC2 Dedicated Hosts Pricing](https://aws.amazon.com/ec2/dedicated-hosts/pricing/)\.
As soon as host recovery is initiated, you are no longer billed for the impaired Dedicated Host\. Billing for the replacement Dedicated Host begins only after it enters the `available` state\.
If the impaired Dedicated Host was billed using the On\-Demand rate, the replacement Dedicated Host is also billed using the On\-Demand rate\. If the impaired Dedicated Host had an active Dedicated Host Reservation, it is transferred to the replacement Dedicated Host\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/dedicated-hosts-recovery.md |
a7bf411db692-0 | If you created your AWS account before December 4, 2013, you might have support for EC2\-Classic in some AWS Regions\. Some Amazon EC2 resources and features, such as enhanced networking and newer instance types, require a virtual private cloud \(VPC\)\. Some resources can be shared between EC2\-Classic and a VPC, while some can't\. For more information, see [Sharing and accessing resources between EC2\-Classic and a VPC](ec2-classic-platform.md#vpc-classic-shared-resources)\. We recommend that you migrate to a VPC to take advantage of VPC\-only features\.
To migrate from EC2\-Classic to a VPC, you must migrate or recreate your EC2\-Classic resources in a VPC\. You can migrate and recreate your resources in full, or you can perform an incremental migration over time using ClassicLink\.
**Topics**
+ [Options for getting a default VPC](#get-default-vpc)
+ [Migrate your resources to a VPC](#full-migrate)
+ [Use ClassicLink for an incremental migration](#classiclink-migrate)
+ [Example: Migrate a simple web application](#vpc-migrate-example) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/vpc-migrate.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.