id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
e6faebc1128b-0 | **To create a security group**
Use one of the following commands:
+ [create\-security\-group](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-security-group.html) \(AWS CLI\)
+ [New\-EC2SecurityGroup](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2SecurityGroup.html) \(AWS Tools for Windows PowerShell\)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
d941e53bd6fd-0 | You can create a new security group by creating a copy of an existing one\. When you copy a security group, the copy is created with the same inbound and outbound rules as the original security group\. If the original security group is in a VPC, the copy is created in the same VPC unless you specify a different one\.
The copy receives a new unique security group ID and you must give it a name\. You can also add a description\.
You can't copy a security group from one Region to another Region\.
You can create a copy of a security group using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
a9c4f97e9b39-0 | **To copy a security group**
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 **Security Groups**\.
1. Select the security group to copy and choose **Actions**, **Copy to new security group**\.
1. Specify a name and optional description, and change the VPC and security group rules if needed\.
1. Choose **Create**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
a9b51bbd425a-0 | **To copy a security group**
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 **Security Groups**\.
1. Select the security group you want to copy, choose **Actions**, **Copy to new**\.
1. The **Create Security Group** dialog opens, and is populated with the rules from the existing security group\. Specify a name and description for your new security group\. For **VPC**, choose the ID of the VPC\. When you are done, choose **Create**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
ab5dbba3d699-0 | You can view information about your security groups using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
3efda79e2fde-0 | **To view your security groups**
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 **Security Groups**\.
1. Your security groups are listed\. To view the details for a specific security group, including its inbound and outbound rules, choose its ID in the **Security group ID** column\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
bdc746836fe2-0 | **To view your security groups**
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 **Security Groups**\.
1. \(Optional\) Select **VPC ID** from the filter list, then choose the ID of the VPC\.
1. Select a security group\. General information is displayed on the **Description** tab, inbound rules on the **Inbound** tab, outbound rules on the **Outbound** tab, and tags on the **Tags** tab\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
54f7d11da410-0 | **To view your security groups**
Use one of the following commands\.
+ [describe\-security\-groups](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-security-groups.html) \(AWS CLI\)
+ [Get\-EC2SecurityGroup](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2SecurityGroup.html) \(AWS Tools for Windows PowerShell\)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
f310ecdfb2ae-0 | When you add a rule to a security group, the new rule is automatically applied to any instances that are associated with the security group\. There might be a short delay before the rule is applied\. For more information about choosing security group rules for specific types of access, see [Security group rules reference](security-group-rules-reference.md)\. For security group rule quotas, see [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html) in the *Amazon VPC User Guide*\.
You can add rules to a security group using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
11af3a426ed7-0 | **To add an inbound rule to a security group**
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 **Security Groups**\.
1. In the list, select the security group and choose **Actions**, **Edit inbound rules**\.
1. Choose **Add rule** and do the following\.
1. For **Type**, choose the type of protocol to allow\.
+ If you choose a custom TCP or UDP protocol, you must manually enter the port range to allow\.
+ If you choose a custom ICMP protocol, you must choose the ICMP type name from **Protocol**, and, if applicable, the code name from **Port range**\.
+ If you choose any other type, the protocol and port range are configured automatically\.
1. For **Source**, do one of the following\.
+ Choose **Custom** and then enter an IP address in CIDR notation, a CIDR block, another security group, or a prefix list from which to allow inbound traffic\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
11af3a426ed7-1 | + Choose **Anywhere** to allow all inbound traffic of the specified protocol to reach your instance\. This option automatically adds the `0.0.0.0/0` IPv4 CIDR block as an allowed source\. This is acceptable for a short time in a test environment, but it's unsafe for production environments\. In production, authorize only a specific IP address or range of addresses to access your instance\.
If your security group is in a VPC that's enabled for IPv6, this option automatically adds a second rule for IPv6 traffic \(`::/0`\)\.
+ Choose **My IP** to allow inbound traffic from only your local computer's public IPv4 address\.
1. For **Description**, optionally specify a brief description for the rule\.
1. Choose **Preview changes**, **Save rules**\.
**To add an outbound rule to a security group**
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 **Security Groups**\.
1. In the list, select the security group and choose **Actions**, **Edit outbound rules**\.
1. Choose **Add rule** and do the following\.
1. For **Type**, choose the type of protocol to allow\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
11af3a426ed7-2 | 1. Choose **Add rule** and do the following\.
1. For **Type**, choose the type of protocol to allow\.
+ If you choose a custom TCP or UDP protocol, you must manually enter the port range to allow\.
+ If you choose a custom ICMP protocol, you must choose the ICMP type name from **Protocol**, and, if applicable, the code name from **Port range**\.
+ If you choose any other type, the protocol and port range are configured automatically\.
1. For **Destination**, do one of the following\.
+ Choose **Custom** and then enter an IP address in CIDR notation, a CIDR block, another security group, or a prefix list for which to allow outbound traffic\.
+ Choose **Anywhere** to allow outbound traffic to all IP addresses\. This option automatically adds the `0.0.0.0/0` IPv4 CIDR block as an allowed source\.
If your security group is in a VPC that's enabled for IPv6, this option automatically adds a second rule for IPv6 traffic \(`::/0`\)\.
+ Choose **My IP** to allow outbound traffic only to your local computer's public IPv4 address\.
1. For **Description**, optionally specify a brief description for the rule\.
1. Choose **Preview changes**, **Confirm**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
5db7c02a54b1-0 | **To add rules to a security group**
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 **Security Groups** and select the security group\.
1. On the **Inbound** tab, choose **Edit**\.
1. In the dialog, choose **Add Rule** and do the following:
+ For **Type**, select the protocol\.
+ If you select a custom TCP or UDP protocol, specify the port range in **Port Range**\.
+ If you select a custom ICMP protocol, choose the ICMP type name from **Protocol**, and, if applicable, the code name from **Port Range**\.
+ For **Source**, choose one of the following:
+ **Custom**: in the provided field, you must specify an IP address in CIDR notation, a CIDR block, or another security group\.
+ **Anywhere**: automatically adds the `0.0.0.0/0` IPv4 CIDR block\. This option enables all traffic of the specified type to reach your instance\. This is acceptable for a short time in a test environment, but it's unsafe for production environments\. In production, authorize only a specific IP address or range of addresses to access your instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
5db7c02a54b1-1 | If your security group is in a VPC that's enabled for IPv6, the **Anywhere** option creates two rules—one for IPv4 traffic \(`0.0.0.0/0`\) and one for IPv6 traffic \(`::/0`\)\.
+ **My IP**: automatically adds the public IPv4 address of your local computer\.
+ For **Description**, you can optionally specify a description for the rule\.
For more information about the types of rules that you can add, see [Security group rules reference](security-group-rules-reference.md)\.
1. Choose **Save**\.
1. You can also specify outbound rules\. On the **Outbound tab**, choose **Edit**, **Add Rule**, and do the following:
+ For **Type**, select the protocol\.
+ If you select a custom TCP or UDP protocol, specify the port range in **Port Range**\.
+ If you select a custom ICMP protocol, choose the ICMP type name from **Protocol**, and, if applicable, the code name from **Port Range**\.
+ For **Destination**, choose one of the following:
+ **Custom**: in the provided field, you must specify an IP address in CIDR notation, a CIDR block, or another security group\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
5db7c02a54b1-2 | + **Custom**: in the provided field, you must specify an IP address in CIDR notation, a CIDR block, or another security group\.
+ **Anywhere**: automatically adds the `0.0.0.0/0` IPv4 CIDR block\. This option enables outbound traffic to all IP addresses\.
If your security group is in a VPC that's enabled for IPv6, the **Anywhere** option creates two rules—one for IPv4 traffic \(`0.0.0.0/0`\) and one for IPv6 traffic \(`::/0`\)\.
+ **My IP**: automatically adds the IP address of your local computer\.
+ For **Description**, you can optionally specify a description for the rule\.
1. Choose **Save**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
e26998f0c5f0-0 | **To add rules to a security group**
Use one of the following commands\.
+ [authorize\-security\-group\-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html) \(AWS CLI\)
+ [Grant\-EC2SecurityGroupIngress](https://docs.aws.amazon.com/powershell/latest/reference/items/Grant-EC2SecurityGroupIngress.html) \(AWS Tools for Windows PowerShell\)
**To add one or more egress rules to a security group**
Use one of the following commands\.
+ [authorize\-security\-group\-egress](https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-egress.html) \(AWS CLI\)
+ [Grant\-EC2SecurityGroupEgress](https://docs.aws.amazon.com/powershell/latest/reference/items/Grant-EC2SecurityGroupEgress.html) \(AWS Tools for Windows PowerShell\)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
608f387db410-0 | You can update a security group rule using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
cbdcb7371357-0 | When you modify the protocol, port range, or source or destination of an existing security group rule using the console, the console deletes the existing rule and adds a new one for you\.
**To update a security group rule**
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 **Security Groups**\.
1. Select the security group to update, choose **Actions**, and then choose **Edit inbound rules** to update a rule for inbound traffic or **Edit outbound rules** to update a rule for outbound traffic\.
1. Update the rule as required and then choose **Preview changes**, **Confirm**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
475735e3df52-0 | When you modify the protocol, port range, or source or destination of an existing security group rule using the console, the console deletes the existing rule and adds a new one for you\.
**To update a security group rule**
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 **Security Groups**\.
1. Select the security group to update, and choose the **Inbound** tab to update a rule for inbound traffic or the **Outbound** tab to update a rule for outbound traffic\.
1. Choose **Edit**\.
1. Modify the rule entry as required and choose **Save**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
6e21f2a36893-0 | You cannot modify the protocol, port range, or source or destination of an existing rule using the Amazon EC2 API or a command line tools\. Instead, you must delete the existing rule and add a new rule\. You can, however, update the description of an existing rule\.
**To update the description for an existing inbound rule**
Use one of the following commands\.
+ [update\-security\-group\-rule\-descriptions\-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/update-security-group-rule-descriptions-ingress.html) \(AWS CLI\)
+ [Update\-EC2SecurityGroupRuleIngressDescription](https://docs.aws.amazon.com/powershell/latest/reference/items/Update-EC2SecurityGroupRuleIngressDescription.html) \(AWS Tools for Windows PowerShell\)
**To update the description for an existing outbound rule**
Use one of the following commands\.
+ [update\-security\-group\-rule\-descriptions\-egress](https://docs.aws.amazon.com/cli/latest/reference/ec2/update-security-group-rule-descriptions-egress.html) \(AWS CLI\) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
6e21f2a36893-1 | + [Update\-EC2SecurityGroupRuleEgressDescription](https://docs.aws.amazon.com/powershell/latest/reference/items/Update-EC2SecurityGroupRuleEgressDescription.html) \(AWS Tools for Windows PowerShell\)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
31b8c0ed5c47-0 | When you delete a rule from a security group, the change is automatically applied to any instances associated with the security group\.
You can delete rules from a security group using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
affa0150c89f-0 | **To delete a security group rule**
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 **Security Groups**\.
1. Select the security group to update, choose **Actions**, and then choose **Edit inbound rules** to remove an inbound rule or **Edit outbound rules** to remove an outbound rule\.
1. Choose the remove button to the right of the rule to delete\.
1. Choose **Preview changes**, **Confirm**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
6391427a4f76-0 | **To delete a security group rule**
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 **Security Groups**\.
1. Select a security group\.
1. On the **Inbound** tab \(for inbound rules\) or **Outbound** tab \(for outbound rules\), choose **Edit**\. Choose **Delete** \(a cross icon\) next to each rule to delete\.
1. Choose **Save**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
06c7017e5d6a-0 | **To remove one or more ingress rules from a security group**
Use one of the following commands\.
+ [revoke\-security\-group\-ingress](https://docs.aws.amazon.com/cli/latest/reference/ec2/revoke-security-group-ingress.html) \(AWS CLI\)
+ [Revoke\-EC2SecurityGroupIngress](https://docs.aws.amazon.com/powershell/latest/reference/items/Revoke-EC2SecurityGroupIngress.html) \(AWS Tools for Windows PowerShell\)
**To remove one or more egress rules from a security group**
Use one of the following commands\.
+ [revoke\-security\-group\-egress](https://docs.aws.amazon.com/cli/latest/reference/ec2/revoke-security-group-egress.html) \(AWS CLI\)
+ [Revoke\-EC2SecurityGroupEgress](https://docs.aws.amazon.com/powershell/latest/reference/items/Revoke-EC2SecurityGroupEgress.html) \(AWS Tools for Windows PowerShell\)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
3d589b829afc-0 | You can't delete a security group that is associated with an instance\. You can't delete the default security group\. You can't delete a security group that is referenced by a rule in another security group in the same VPC\. If your security group is referenced by one of its own rules, you must delete the rule before you can delete the security group\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
0b9f9e2a6a66-0 | **To delete a security group**
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 **Security Groups**\.
1. Select the security group to delete and choose **Actions**, **Delete security group**, **Delete**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
06bf117d55fa-0 | **To delete a security group**
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 **Security Groups**\.
1. Select a security group and choose **Actions**, **Delete Security Group**\.
1. Choose **Yes, Delete**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
6c853837d450-0 | **To delete a security group**
Use one of the following commands\.
+ [delete\-security\-group](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-security-group.html) \(AWS CLI\)
+ [Remove\-EC2SecurityGroup](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2SecurityGroup.html) \(AWS Tools for Windows PowerShell\)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/working-with-security-groups.md |
d4048a99d37a-0 | When resources are created, we assign each resource a unique resource ID\. You can use resource IDs to find your resources in the Amazon EC2 console\. If you are using a command line tool or the Amazon EC2 API to work with Amazon EC2, resource IDs are required for certain commands\. For example, if you are using the [stop\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/stop-instances.html) AWS CLI command to stop an instance, you must specify the instance ID in the command\.
**Resource ID length**
A resource ID takes the form of a resource identifier \(such as `snap` for a snapshot\) followed by a hyphen and a unique combination of letters and numbers\. Starting in January 2016, we're gradually introducing longer length IDs for Amazon EC2 and Amazon EBS resource types\. The length of the alphanumeric character combination was in an 8\-character format; the new IDs are in a 17\-character format, for example, `i-1234567890abcdef0` for an instance ID\.
Supported resource types have an opt\-in period, during which you can choose a resource ID format, and a deadline date, after which the resource defaults to the longer ID format\. After the deadline has passed for a specific resource type, you can no longer disable the longer ID format for that resource type\.
Different resource types have different opt\-in periods and deadline dates\. The following table lists the supported resource types, along with their opt\-in periods and deadline dates\.
| Resource type | Opt\-in period | Deadline date | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
d4048a99d37a-1 | | Resource type | Opt\-in period | Deadline date |
| --- | --- | --- |
| `instance` \| `snapshot` \|`reservation` \| `volume` | No longer available | December 15, 2016 |
| `bundle` \| `conversion-task` \| `customer-gateway` \| `dhcp-options` \| `elastic-ip-allocation` \| `elastic-ip-association` \| `export-task` \| `flow-log` \| `image` \| `import-task` \| `internet-gateway` \| `network-acl` \| `network-acl-association` \| `network-interface` \| `network-interface-attachment` \| `prefix-list` \| `route-table` \| `route-table-association` \| `security-group` \| `subnet` \| `subnet-cidr-block-association` \| `vpc` \| `vpc-cidr-block-association` \| `vpc-endpoint` \| `vpc-peering-connection` \| `vpn-connection` \| `vpn-gateway` | February 09, 2018 \- June 30, 2018 | June 30, 2018 |
**During the opt\-in period**
You can enable or disable longer IDs for a resource at any time during the opt\-in period\. After you've enabled longer IDs for a resource type, any new resources that you create are created with a longer ID\.
**Note** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
d4048a99d37a-2 | **Note**
A resource ID does not change after it's created\. Therefore, enabling or disabling longer IDs during the opt\-in period does not affect your existing resource IDs\.
Depending on when you created your AWS account, supported resource types may default to using longer IDs\. However, you can opt out of using longer IDs until the deadline date for that resource type\. For more information, see [Longer EC2 and EBS Resource IDs](https://aws.amazon.com/ec2/faqs/#longer-ids) in the *Amazon EC2 FAQs*\.
**After the deadline**
You can’t disable longer IDs for a resource type after its deadline date has passed\. Any new resources that you create are created with a longer ID\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
963cfa58a879-0 | You can enable or disable longer IDs per IAM user and IAM role\. By default, an IAM user or role defaults to the same settings as the root user\.
**Topics**
+ [Viewing longer ID settings](#viewing_longer_id_settings)
+ [Modifying longer ID settings](#modifying_longer_id_settings) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
bdb322f7f92e-0 | You can use the console and command line tools to view the resource types that support longer IDs\.
**To view your longer ID settings 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 bar at the top of the screen, select the Region for which to view your longer ID settings\.
1. From the dashboard, under **Account Attributes**, choose **Resource ID length management**\.
1. Expand **Advanced Resource ID Management** to view the resource types that support longer IDs and their deadline dates\.
**To view your longer ID settings using the command line**
Use one of the following commands:
+ [describe\-id\-format](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-id-format.html) \(AWS CLI\)
```
aws ec2 describe-id-format --region region
```
+ [Get\-EC2IdFormat](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2IdFormat.html) \(AWS Tools for Windows PowerShell\)
```
Get-EC2IdFormat -Region region
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
bdb322f7f92e-1 | ```
Get-EC2IdFormat -Region region
```
**To view longer ID settings for a specific IAM user or IAM role using the command line**
Use one of the following commands and specify the ARN of an IAM user, IAM role, or root account user in the request\.
+ [describe\-identity\-id\-format](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-identity-id-format.html) \(AWS CLI\)
```
aws ec2 describe-identity-id-format --principal-arn arn-of-iam-principal --region region
```
+ [Get\-EC2IdentityIdFormat](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2IdentityIdFormat.html) \(AWS Tools for Windows PowerShell\)
```
Get-EC2IdentityIdFormat -PrincipalArn arn-of-iam-principal -Region region
```
**To view the aggregated longer ID settings for a specific Region using the command line** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
bdb322f7f92e-2 | ```
**To view the aggregated longer ID settings for a specific Region using the command line**
Use the [describe\-aggregate\-id\-format](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-aggregate-id-format.html) AWS CLI command to view the aggregated longer ID setting for the entire region, as well as the aggregated longer ID setting of all ARNs for each resource type\. This command is useful for performing a quick audit to determine whether a specific Region is fully opted in for longer IDs\.
```
aws ec2 describe-aggregate-id-format --region region
```
**To identify users who have explicitly defined custom longer ID settings**
Use the [describe\-principal\-id\-format](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-principal-id-format.html) AWS CLI command to view the longer ID format settings for the root user and all IAM roles and IAM users that have explicitly specified a longer ID preference\. This command is useful for identifying IAM users and IAM roles that have overridden the default longer ID settings\.
```
aws ec2 describe-principal-id-format --region region
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
9ebab582246c-0 | You can use the console and command line tools to modify longer ID settings for resource types that are still within their opt\-in period\.
**Note**
The AWS CLI and AWS Tools for Windows PowerShell commands in this section are per\-region only\. They apply to the default Region unless otherwise specified\. To modify the settings for other regions, include the `region` parameter in the command\.
**To modify longer ID settings 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 bar at the top of the screen, select the Region for which to modify the longer ID settings\.
1. From the dashboard, under **Account Attributes**, choose **Resource ID length management**\.
1. Do one of the following:
+ To enable longer IDs for all supported resource types for all IAM users across all regions, choose **Switch to longer IDs**, **Yes, switch to longer IDs**\.
**Important**
IAM users and IAM roles need the `ec2:ModifyIdentityIdFormat` permission to perform this action\.
+ To modify longer ID settings for a specific resource type for your IAM user account, expand **Advanced Resource ID Management**, and then select the corresponding check box in the **My IAM Role/User** column to enable longer IDs, or clear the check box to disable longer IDs\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
9ebab582246c-1 | + To modify longer ID settings for a specific resource type for all IAM users, expand **Advanced Resource ID Management**, and then select the corresponding check box in the **All IAM Roles/Users** column to enable longer IDs, or clear the check box to disable longer IDs\.
**To modify longer ID settings for your IAM user account using the command line**
Use one of the following commands:
**Note**
If you’re using these commands as the root user, then changes apply to the entire AWS account, unless an IAM user or role explicitly overrides these settings for themselves\.
+ [modify\-id\-format](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-id-format.html) \(AWS CLI\)
```
aws ec2 modify-id-format --resource resource_type --use-long-ids
```
You can also use the command to modify the longer ID settings for all supported resource types\. To do this, replace the `resource_type` parameter with `all-current`\.
```
aws ec2 modify-id-format --resource all-current --use-long-ids
```
**Note**
To disable longer IDs, replace the `use-long-ids` parameter with `no-use-long-ids`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
9ebab582246c-2 | To disable longer IDs, replace the `use-long-ids` parameter with `no-use-long-ids`\.
+ [Edit\-EC2IdFormat](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2IdFormat.html) \(AWS Tools for Windows PowerShell\)
```
Edit-EC2IdFormat -Resource resource_type -UseLongId boolean
```
You can also use the command to modify the longer ID settings for all supported resource types\. To do this, replace the `resource_type` parameter with `all-current`\.
```
Edit-EC2IdFormat -Resource all-current -UseLongId boolean
```
**To modify longer ID settings for a specific IAM user or IAM role using the command line**
Use one of the following commands and specify the ARN of an IAM user, IAM role, or root user in the request\.
+ [modify\-identity\-id\-format](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-identity-id-format.html) \(AWS CLI\)
```
aws ec2 modify-identity-id-format --principal-arn arn-of-iam-principal --resource resource_type --use-long-ids
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
9ebab582246c-3 | ```
You can also use the command to modify the longer ID settings for all supported resource types\. To do this, specify `all-current` for the `--resource` parameter\.
```
aws ec2 modify-identity-id-format --principal-arn arn-of-iam-principal --resource all-current --use-long-ids
```
**Note**
To disable longer IDs, replace the `use-long-ids` parameter with `no-use-long-ids`\.
+ [Edit\-EC2IdentityIdFormat](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2IdentityIdFormat.html) \(AWS Tools for Windows PowerShell\)
```
Edit-EC2IdentityIdFormat -PrincipalArn arn-of-iam-principal -Resource resource_type -UseLongId boolean
```
You can also use the command to modify the longer ID settings for all supported resource types\. To do this, specify `all-current` for the `-Resource` parameter\.
```
Edit-EC2IdentityIdFormat -PrincipalArn arn-of-iam-principal -Resource all-current -UseLongId boolean
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
c3efd03416be-0 | By default, IAM users and roles do not have permission to use the following actions unless they're explicitly granted permission through their associated IAM policies:
+ `ec2:DescribeIdFormat`
+ `ec2:DescribeIdentityIdFormat`
+ `ec2:DescribeAggregateIdFormat`
+ `ec2:DescribePrincipalIdFormat`
+ `ec2:ModifyIdFormat`
+ `ec2:ModifyIdentityIdFormat`
For example, an IAM role may have permission to use all Amazon EC2 actions through an `"Action": "ec2:*"` element in the policy statement\.
To prevent IAM users and roles from viewing or modifying the longer resource ID settings for themselves or other users and roles in your account, ensure that the IAM policy contains the following statement:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"ec2:ModifyIdFormat",
"ec2:DescribeIdFormat",
"ec2:ModifyIdentityIdFormat",
"ec2:DescribeIdentityIdFormat",
"ec2:DescribeAggregateIdFormat",
"ec2:DescribePrincipalIdFormat"
],
"Resource": "*"
}
] | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
c3efd03416be-1 | ],
"Resource": "*"
}
]
}
```
We do not support resource\-level permissions for the following actions:
+ `ec2:DescribeIdFormat`
+ `ec2:DescribeIdentityIdFormat`
+ `ec2:DescribeAggregateIdFormat`
+ `ec2:DescribePrincipalIdFormat`
+ `ec2:ModifyIdFormat`
+ `ec2:ModifyIdentityIdFormat` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/resource-ids.md |
3a76e89b04d4-0 | Connect to the Linux instances that you launched and transfer files between your local computer and your instance\.
To connect to a Windows instance, see [Connecting to Your Windows Instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html) in the *Amazon EC2 User Guide for Windows Instances*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AccessingInstances.md |
ba27c16a8448-0 | The operating system of your local computer determines the options that you have to connect from your local computer to your Linux instance\.
**If your local computer operating system is Linux or macOS X**
+ [SSH client](AccessingInstancesLinux.md)
+ [EC2 Instance Connect](Connect-using-EC2-Instance-Connect.md)
+ [AWS Systems Manager Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html)
**If your local computer operating system is Windows**
+ [PuTTY](putty.md)
+ [SSH client](AccessingInstancesLinux.md)
+ [AWS Systems Manager Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html)
+ [Windows Subsystem for Linux](WSL.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AccessingInstances.md |
0287e9ef88ee-0 | You can test the performance of Amazon EBS volumes by simulating I/O workloads\. The process is as follows:
1. Launch an EBS\-optimized instance\.
1. Create new EBS volumes\.
1. Attach the volumes to your EBS\-optimized instance\.
1. Configure and mount the block device\.
1. Install a tool to benchmark I/O performance\.
1. Benchmark the I/O performance of your volumes\.
1. Delete your volumes and terminate your instance so that you don't continue to incur charges\.
**Important**
Some of the procedures result in the destruction of existing data on the EBS volumes you benchmark\. The benchmarking procedures are intended for use on volumes specially created for testing purposes, not production volumes\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
40276c0ab0ec-0 | To get optimal performance from EBS volumes, we recommend that you use an EBS\-optimized instance\. EBS\-optimized instances deliver dedicated throughput between Amazon EC2 and Amazon EBS, with instance\. EBS\-optimized instances deliver dedicated bandwidth between Amazon EC2 and Amazon EBS, with specifications depending on the instance type\. For more information, see [Amazon EBS–optimized instances](ebs-optimized.md)\.
To create an EBS\-optimized instance, choose **Launch as an EBS\-Optimized instance** when launching the instance using the Amazon EC2 console, or specify \-\-ebs\-optimized when using the command line\. Be sure that you launch a current\-generation instance that supports this option\. For more information, see [Amazon EBS–optimized instances](ebs-optimized.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
953e715104aa-0 | To create an `io1` or `io2` volume, choose **Provisioned IOPS SSD \(`io1`\)** or **Provisioned IOPS SSD \(`io2`\)** when creating the volume using the Amazon EC2 console, or, at the command line, specify \-\-volume\-type *io1*\|*io2* \-\-iops *n* where *n* is an integer between 100 and 64,000\. For more detailed EBS\-volume specifications, see [Amazon EBS volume types](ebs-volume-types.md)\. For information about creating an EBS volume, see [Creating an Amazon EBS volume](ebs-creating-volume.md)\. For information about attaching a volume to an instance, see [Attaching an Amazon EBS volume to an instance](ebs-attaching-volume.md)\.
For the example tests, we recommend that you create a RAID array with 6 volumes, which offers a high level of performance\. Because you are charged by gigabytes provisioned \(and the number of provisioned IOPS for `io1` and `io2` volumes\), not the number of volumes, there is no additional cost for creating multiple, smaller volumes and using them to create a stripe set\. If you're using Oracle Orion to benchmark your volumes, it can simulate striping the same way that Oracle ASM does, so we recommend that you let Orion do the striping\. If you are using a different benchmarking tool, you need to stripe the volumes yourself\.
To create a six\-volume stripe set on Amazon Linux, use a command such as the following:
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
953e715104aa-1 | To create a six\-volume stripe set on Amazon Linux, use a command such as the following:
```
[ec2-user ~]$ sudo mdadm --create /dev/md0 --level=0 --chunk=64 --raid-devices=6 /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk
```
For this example, the file system is XFS\. Use the file system that meets your requirements\. Use the following command to install XFS file system support:
```
[ec2-user ~]$ sudo yum install -y xfsprogs
```
Then, use these commands to create, mount, and assign ownership to the XFS file system:
```
[ec2-user ~]$ sudo mkdir -p /mnt/p_iops_vol0 && sudo mkfs.xfs /dev/md0
[ec2-user ~]$ sudo mount -t xfs /dev/md0 /mnt/p_iops_vol0
[ec2-user ~]$ sudo chown ec2-user:ec2-user /mnt/p_iops_vol0/
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
0b4807b343d9-0 | To create an `st1` volume, choose **Throughput Optimized HDD** when creating the volume using the Amazon EC2 console, or specify \-\-type `st1` when using the command line\. To create an `sc1` volume, choose Cold HDD when creating the volume using the Amazon EC2 console, or specify \-\-type `sc1` when using the command line\. For information about creating EBS volumes, see [Creating an Amazon EBS volume](ebs-creating-volume.md)\. For information about attaching these volumes to your instance, see [Attaching an Amazon EBS volume to an instance](ebs-attaching-volume.md)\.
AWS provides a JSON template for use with AWS CloudFormation that simplifies this setup procedure\. Access the [template](https://s3.amazonaws.com/cloudformation-examples/community/st1_cloudformation_template.json) and save it as a JSON file\. AWS CloudFormation allows you to configure your own SSH keys and offers an easier way to set up a performance test environment to evaluate `st1` volumes\. The template creates a current\-generation instance and a 2 TiB `st1` volume, and attaches the volume to the instance at `/dev/xvdf`\.
**To create an HDD volume using the template**
1. Open the AWS CloudFormation console at [https://console\.aws\.amazon\.com/cloudformation](https://console.aws.amazon.com/cloudformation/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
0b4807b343d9-1 | 1. Choose **Create Stack**\.
1. Choose **Upload a Template to Amazon S3** and select the JSON template you previously obtained\.
1. Give your stack a name like “ebs\-perf\-testing”, and select an instance type \(the default is r3\.8xlarge\) and SSH key\.
1. Choose **Next** twice, and then choose **Create Stack**\.
1. After the status for your new stack moves from **CREATE\_IN\_PROGRESS** to **COMPLETE**, choose **Outputs** to get the public DNS entry for your new instance, which will have a 2 TiB `st1` volume attached to it\.
1. Connect using SSH to your new stack as user **ec2\-user**, with the hostname obtained from the DNS entry in the previous step\.
1. Proceed to [Install benchmark tools](#install_tools)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
50a73d8128fc-0 | The following table lists some of the possible tools you can use to benchmark the performance of EBS volumes\.
| Tool | Description |
| --- | --- |
| fio | For benchmarking I/O performance\. \(Note that fio has a dependency on `libaio-devel`\.\) To install fio on Amazon Linux, run the following command: <pre>[ec2-user ~]$ sudo yum install -y fio</pre> To install fio on Ubuntu, run the following command: <pre>sudo apt-get install -y fio</pre> |
| [Oracle Orion Calibration Tool](https://docs.oracle.com/cd/E18283_01/server.112/e16638/iodesign.htm#BABFCFBC) | For calibrating the I/O performance of storage systems to be used with Oracle databases\. |
These benchmarking tools support a wide variety of test parameters\. You should use commands that approximate the workloads your volumes will support\. These commands provided below are intended as examples to help you get started\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
7359013e3614-0 | Choosing the best volume queue length based on your workload and volume type\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
49bab3c37a91-0 | To determine the optimal queue length for your workload on SSD\-backed volumes, we recommend that you target a queue length of 1 for every 1000 IOPS available \(baseline for `gp2` volumes and the provisioned amount for `io1` and `io2` volumes\)\. Then you can monitor your application performance and tune that value based on your application requirements\.
Increasing the queue length is beneficial until you achieve the provisioned IOPS, throughput or optimal system queue length value, which is currently set to 32\. For example, a volume with 3,000 provisioned IOPS should target a queue length of 3\. You should experiment with tuning these values up or down to see what performs best for your application\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
5a0c68bcb43a-0 | To determine the optimal queue length for your workload on HDD\-backed volumes, we recommend that you target a queue length of at least 4 while performing 1MiB sequential I/Os\. Then you can monitor your application performance and tune that value based on your application requirements\. For example, a 2 TiB `st1` volume with burst throughput of 500 MiB/s and IOPS of 500 should target a queue length of 4, 8, or 16 while performing | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
5a0c68bcb43a-1 | length of 4, 8, or 16 while performing 1,024 KiB, 512 KiB, or 256 KiB sequential I/Os respectively\. You should experiment with tuning these values value up or down to see what performs best for your application\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
154018d6256a-0 | Before you run benchmarking, you should disable processor C\-states\. Temporarily idle cores in a supported CPU can enter a C\-state to save power\. When the core is called on to resume processing, a certain amount of time passes until the core is again fully operational\. This latency can interfere with processor benchmarking routines\. For more information about C\-states and which EC2 instance types support them, see [Processor State Control for Your EC2 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
154018d6256a-1 | see [Processor State Control for Your EC2 Instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/processor_state_control.html)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
ce1d9175018a-0 | You can disable C\-states on Amazon Linux, RHEL, and CentOS as follows:
1. Get the number of C\-states\.
```
$ cpupower idle-info | grep "Number of idle states:"
```
1. Disable the C\-states from c1 to cN\. Ideally, the cores should be in state c0\.
```
$ for i in `seq 1 $((N-1))`; do cpupower idle-set -d $i; done
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
62a2794f26f1-0 | The following procedures describe benchmarking commands for various EBS volume types\.
Run the following commands on an EBS\-optimized instance with attached EBS volumes\. If the EBS volumes were created from snapshots, be sure to initialize them before benchmarking\. For more information, see [Initializing Amazon EBS volumes](ebs-initialize.md)\.
When you are finished testing your volumes, see the following topics for help cleaning up: [Deleting an Amazon EBS volume](ebs-deleting-volume.md) and [Terminate your instance](terminating-instances.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
fedc7522c726-0 | Run fio on the stripe set that you created\.
The following command performs 16 KB random write operations\.
```
[ec2-user ~]$ sudo fio --directory=/mnt/p_iops_vol0 --name fio_test_file --direct=1 --rw=randwrite --bs=16k --size=1G --numjobs=16 --time_based --runtime=180 --group_reporting --norandommap
```
The following command performs 16 KB random read operations\.
```
[ec2-user ~]$ sudo fio --directory=/mnt/p_iops_vol0 --name fio_test_file --direct=1 --rw=randread --bs=16k --size=1G --numjobs=16 --time_based --runtime=180 --group_reporting --norandommap
```
For more information about interpreting the results, see this tutorial: [Inspecting disk IO performance with fio](https://www.linux.com/tutorials/inspecting-disk-io-performance-fio/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
8359298f3557-0 | Run fio on your `st1` or `sc1` volume\.
**Note**
Prior to running these tests, set buffered I/O on your instance as described in [Increase read\-ahead for high\-throughput, read\-heavy workloads on `st1` and `sc1`](EBSPerformance.md#read_ahead)\.
The following command performs 1 MiB sequential read operations against an attached `st1` block device \(e\.g\., `/dev/xvdf`\):
```
[ec2-user ~]$ sudo fio --filename=/dev/<device> --direct=1 --rw=read --randrepeat=0 --ioengine=libaio --bs=1024k --iodepth=8 --time_based=1 --runtime=180 --name=fio_direct_read_test
```
The following command performs 1 MiB sequential write operations against an attached `st1` block device:
```
[ec2-user ~]$ sudo fio --filename=/dev/<device> --direct=1 --rw=write --randrepeat=0 --ioengine=libaio --bs=1024k --iodepth=8 --time_based=1 --runtime=180 --name=fio_direct_write_test
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
8359298f3557-1 | ```
Some workloads perform a mix of sequential reads and sequential writes to different parts of the block device\. To benchmark such a workload, we recommend that you use separate, simultaneous fio jobs for reads and writes, and use the fio `offset_increment` option to target different block device locations for each job\.
Running this workload is a bit more complicated than a sequential\-write or sequential\-read workload\. Use a text editor to create a fio job file, called `fio_rw_mix.cfg` in this example, that contains the following:
```
[global]
clocksource=clock_gettime
randrepeat=0
runtime=180
offset_increment=100g
[sequential-write]
bs=1M
ioengine=libaio
direct=1
iodepth=8
filename=/dev/<device>
do_verify=0
rw=write
rwmixread=0
rwmixwrite=100
[sequential-read]
bs=1M
ioengine=libaio
direct=1
iodepth=8
filename=/dev/<device>
do_verify=0
rw=read
rwmixread=100
rwmixwrite=0
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
8359298f3557-2 | rw=read
rwmixread=100
rwmixwrite=0
```
Then run the following command:
```
[ec2-user ~]$ sudo fio fio_rw_mix.cfg
```
For more information about interpreting the results, see this tutorial: [Inspecting disk I/O performance with fio](https://www.linux.com/tutorials/inspecting-disk-io-performance-fio/)\.
Multiple fio jobs for direct I/O, even though using sequential read or write operations, can result in lower than expected throughput for `st1` and `sc1` volumes\. We recommend that you use one direct I/O job and use the `iodepth` parameter to control the number of concurrent I/O operations\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/benchmark_procedures.md |
d8756ec46ed5-0 | Demand for Spot Instances can vary significantly from moment to moment, and the availability of Spot Instances can also vary significantly depending on how many unused EC2 instances are available\. It is always possible that your Spot Instance might be interrupted\. Therefore, you must ensure that your application is prepared for a Spot Instance interruption\.
An On\-Demand Instance specified in an EC2 Fleet or Spot Fleet cannot be interrupted\.
**Topics**
+ [Reasons for interruption](#interruption-reasons)
+ [Interruption behaviors](#interruption-behavior)
+ [Specifying the interruption behavior](#specifying-spot-interruption-behavior)
+ [Preparing for interruptions](#using-spot-instances-managing-interruptions)
+ [Preparing for instance hibernation](#prepare-for-instance-hibernation)
+ [Spot Instance interruption notices](#spot-instance-termination-notices)
+ [Finding interrupted Spot Instances](#finding-an-interrupted-Spot-Instance)
+ [Determining whether Amazon EC2 interrupted a Spot Instance](#BidEvictedEvent)
+ [Billing for interrupted Spot Instances](#billing-for-interrupted-spot-instances) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
c4219fe4ea86-0 | The following are the possible reasons that Amazon EC2 might interrupt your Spot Instances:
+ Price – The Spot price is greater than your maximum price\.
+ Capacity – If there are not enough unused EC2 instances to meet the demand for Spot Instances, Amazon EC2 interrupts Spot Instances\. The order in which the instances are interrupted is determined by Amazon EC2\.
+ Constraints – If your request includes a constraint such as a launch group or an Availability Zone group, these Spot Instances are terminated as a group when the constraint can no longer be met\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
9a6c35f1b64a-0 | You can specify that Amazon EC2 should do one of the following when it interrupts a Spot Instance:
+ Stop the Spot Instance
+ Hibernate the Spot Instance
+ Terminate the Spot Instance
The default is to terminate Spot Instances when they are interrupted\. To change the interruption behavior, see [Specifying the interruption behavior](#specifying-spot-interruption-behavior)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
63aac178cbde-0 | You can specify the interruption behavior so that Amazon EC2 stops Spot Instances when they are interrupted if the following requirements are met\.
**Requirements**
+ For a Spot Instance request, the type must be `persistent`\. You cannot specify a launch group in the Spot Instance request\.
+ For an EC2 Fleet or Spot Fleet request, the type must be `maintain`\.
+ The root volume must be an EBS volume, not an instance store volume\.
After a Spot Instance is stopped by the Spot service, only the Spot service can restart the Spot Instance, and the same launch specification must be used\.
For a Spot Instance launched by a `persistent` Spot Instance request, the Spot service restarts the stopped instance when capacity is available in the same Availability Zone and for the same instance type as the stopped instance\.
If instances in an EC2 Fleet or Spot Fleet are stopped and the fleet is of type `maintain`, the Spot service launches replacement instances to maintain the target capacity\. The Spot service finds the best pools based on the specified allocation strategy \(`lowestPrice`, `diversified`, or `InstancePoolsToUseCount`\); it does not prioritize the pool with the earlier stopped instances\. Later, if the allocation strategy leads to a pool containing the earlier stopped instances, the Spot service restarts the stopped instances to meet the target capacity\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
63aac178cbde-1 | For example, consider a Spot Fleet with the `lowestPrice` allocation strategy\. At initial launch, a `c3.large` pool meets the `lowestPrice` criteria for the launch specification\. Later, when the `c3.large` instances are interrupted, the Spot service stops the instances and replenishes capacity from another pool that fits the `lowestPrice` strategy\. This time, the pool happens to be a `c4.large` pool and the Spot service launches `c4.large` instances to meet the target capacity\. Similarly, Spot Fleet could move to a `c5.large` pool the next time\. In each of these transitions, the Spot service does not prioritize pools with earlier stopped instances, but rather prioritizes purely on the specified allocation strategy\. The `lowestPrice` strategy can lead back to pools with earlier stopped instances\. For example, if instances are interrupted in the `c5.large` pool and the `lowestPrice` strategy leads it back to the `c3.large` or `c4.large` pools, the earlier stopped instances are restarted to fulfill target capacity\.
While a Spot Instance is stopped, you can modify some of its instance attributes, but not the instance type\. If you detach or delete an EBS volume, it is not attached when the Spot Instance is started\. If you detach the root volume and the Spot service attempts to start the Spot Instance, instance start fails and the Spot service terminates the stopped instance\.
You can terminate a Spot Instance while it is stopped\. If you cancel a Spot request, an EC2 Fleet, or a Spot Fleet, the Spot service terminates any associated Spot Instances that are stopped\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
63aac178cbde-2 | While a Spot Instance is stopped, you are charged only for the EBS volumes, which are preserved\. With EC2 Fleet and Spot Fleet, if you have many stopped instances, you can exceed the limit on the number of EBS volumes for your account\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b62197d54616-0 | You can specify the interruption behavior so that Amazon EC2 hibernates Spot Instances when they are interrupted if the following requirements are met\.
**Requirements**
+ For a Spot Instance request, the type must be `persistent`\. You cannot specify a launch group in the Spot Instance request\.
+ For an EC2 Fleet or Spot Fleet request, the type must be `maintain`\.
+ The root volume must be an EBS volume, not an instance store volume, and it must be large enough to store the instance memory \(RAM\) during hibernation\.
+ The following instances are supported: C3, C4, C5, M4, M5, R3, and R4, with less than 100 GB of memory\.
+ The following operating systems are supported: Amazon Linux 2, Amazon Linux AMI, Ubuntu with an AWS\-tuned Ubuntu kernel \(linux\-aws\) greater than 4\.4\.0\-1041, and Windows Server 2008 R2 and later\.
+ Install the hibernation agent on a supported operating system, or use one of the following AMIs, which already include the agent:
+ Amazon Linux 2
+ Amazon Linux AMI 2017\.09\.1 or later
+ Ubuntu Xenial 16\.04 20171121 or later
+ Windows Server 2008 R2 AMI 2017\.11\.19 or later
+ Windows Server 2012 or Windows Server 2012 R2 AMI 2017\.11\.19 or later
+ Windows Server 2016 AMI 2017\.11\.19 or later
+ Windows Server 2019 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b62197d54616-1 | + Windows Server 2016 AMI 2017\.11\.19 or later
+ Windows Server 2019
+ Start the agent\. We recommend that you use user data to start the agent on instance startup\. Alternatively, you could start the agent manually\.
**Recommendation**
+ We strongly recommend that you use an encrypted Amazon EBS volume as the root volume, because instance memory is stored on the root volume during hibernation\. This ensures that the contents of memory \(RAM\) are encrypted when the data is at rest on the volume and when data is moving between the instance and volume\. Use one of the following three options to ensure that the root volume is an encrypted Amazon EBS volume:
+ EBS “single\-step” encryption: In a single run\-instances API call, you can launch encrypted EBS\-backed EC2 instances from an unencrypted AMI\. For more information, see [Using encryption with EBS\-backed AMIs](AMIEncryption.md)\.
+ EBS encryption by default: You can enable EBS encryption by default to ensure all new EBS volumes created in your AWS account are encrypted\. For more information, see [Encryption by default](EBSEncryption.md#encryption-by-default)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b62197d54616-2 | + Encrypted AMI: You can enable EBS encryption by using an encrypted AMI to launch your instance\. If your AMI does not have an encrypted root snapshot, you can copy it to a new AMI and request encryption\. For more information, see [Encrypt an unencrypted image during copy](AMIEncryption.md#copy-unencrypted-to-encrypted) and [Copying an AMI](CopyingAMIs.md#ami-copy-steps)\.
When a Spot Instance is hibernated by the Spot service, the EBS volumes are preserved and instance memory \(RAM\) is preserved on the root volume\. The private IP addresses of the instance are also preserved\. Instance storage volumes and public IP addresses, other than Elastic IP addresses, are not preserved\. While the instance is hibernating, you are charged only for the EBS volumes\. With EC2 Fleet and Spot Fleet, if you have many hibernated instances, you can exceed the limit on the number of EBS volumes for your account\.
The agent prompts the operating system to hibernate when the instance receives a signal from the Spot service\. If the agent is not installed, the underlying operating system doesn't support hibernation, or there isn't enough volume space to save the instance memory, hibernation fails and the Spot service stops the instance instead\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b62197d54616-3 | When the Spot service hibernates a Spot Instance, you receive an interruption notice, but you do not have two minutes before the Spot Instance is interrupted\. Hibernation begins immediately\. While the instance is in the process of hibernating, instance health checks might fail\. When the hibernation process completes, the state of the instance is `stopped`\.
**Resuming a hibernated Spot Instance**
After a Spot Instance is hibernated by the Spot service, it can only be resumed by the Spot service\. The Spot service resumes the instance when capacity becomes available with a Spot price that is less than your specified maximum price\.
For more information, see [Preparing for instance hibernation](#prepare-for-instance-hibernation)\.
For information about hibernating On\-Demand Instances, see [Hibernate your Linux instance](Hibernate.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
7bdca0a6a802-0 | If you do not specify an interruption behavior, the default is to terminate Spot Instances when they are interrupted\. You can specify the interruption behavior when you create a Spot request\. The way in which you specify the interruption behavior is different depending on how you request Spot Instances\.
If you request Spot Instances using the [launch instance wizard](launching-instance.md), you can specify the interruption behavior as follows: Select the **Persistent request** check box and then, from **Interruption behavior**, choose an interruption behavior\.
If you request Spot Instances using the [Spot console](spot-fleet-requests.md#create-spot-fleet), you can specify the interruption behavior as follows: Select the **Maintain target capacity** check box and then, from **Interruption behavior**, choose an interruption behavior\.
If you configure Spot Instances in a [launch template](ec2-launch-templates.md#create-launch-template), you can specify the interruption behavior as follows: In the launch template, expand **Advanced details** and select the **Request Spot Instances** checkbox\. Choose **Customize** and then, from **Interruption behavior**, choose an interruption behavior\.
If you configure Spot Instances in a launch configuration when using the [request\-spot\-fleet](https://docs.aws.amazon.com/cli/latest/reference/ec2/request-spot-fleet.html) CLI, you can specify the interruption behavior as follows: For `InstanceInterruptionBehavior`, specify an interruption behavior\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
7bdca0a6a802-1 | If you configure Spot Instances using the [request\-spot\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/request-spot-instances.html) CLI, you can specify the interruption behavior as follows: For `--instance-interruption-behavior`, specify an interruption behavior\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
8f242be23867-0 | Here are some best practices to follow when you use Spot Instances:
+ Use the default maximum price, which is the On\-Demand price\.
+ Ensure that your instance is ready to go as soon as the request is fulfilled by using an Amazon Machine Image \(AMI\) that contains the required software configuration\. You can also use user data to run commands at start\-up\.
+ Store important data regularly in a place that isn't affected when the Spot Instance terminates\. For example, you can use Amazon S3, Amazon EBS, or DynamoDB\.
+ Divide the work into small tasks \(using a Grid, Hadoop, or queue\-based architecture\) or use checkpoints so that you can save your work frequently\.
+ Use Spot Instance interruption notices to monitor the status of your Spot Instances\.
+ While we make every effort to provide this warning as soon as possible, it is possible that your Spot Instance is terminated before the warning can be made available\. Test your application to ensure that it handles an unexpected instance termination gracefully, even if you are testing for interruption notices\. You can do so by running the application using an On\-Demand Instance and then terminating the On\-Demand Instance yourself\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
1cd1d43063f1-0 | You must install a hibernation agent on your instance, unless you used an AMI that already includes the agent\. You must run the agent on instance startup, whether the agent was included in your AMI or you installed it yourself\.
The following procedures help you prepare a Linux instance\. For directions to prepare a Windows instance, see [Preparing for instance hibernation](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/spot-interruptions.html#prepare-for-instance-hibernation) in the *Amazon EC2 User Guide for Windows Instances*\.
**To prepare an Amazon Linux instance**
1. Verify that your kernel supports hibernation and update the kernel if necessary\.
1. If your AMI doesn't include the agent, install the agent using the following command\.
```
sudo yum update; sudo yum install hibagent
```
1. Add the following to the user data:
```
#!/bin/bash
/usr/bin/enable-ec2-spot-hibernation
```
**To prepare an Ubuntu instance**
1. If your AMI doesn't include the agent, install the agent using the following command\. The hibernation agent is only available on Ubuntu 16\.04 or later\.
```
sudo apt-get install hibagent
```
1. Add the following to the user data\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
1cd1d43063f1-1 | sudo apt-get install hibagent
```
1. Add the following to the user data\.
```
#!/bin/bash
/usr/bin/enable-ec2-spot-hibernation
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
fafb96b7d983-0 | The best way for you to gracefully handle Spot Instance interruptions is to architect your application to be fault\-tolerant\. To accomplish this, you can take advantage of *Spot Instance interruption notices*\. A Spot Instance interruption notice is a warning that is issued two minutes before Amazon EC2 stops or terminates your Spot Instance\. If you specify hibernation as the interruption behavior, you receive an interruption notice, but you do not receive a two\-minute warning because the hibernation process begins immediately\.
We recommend that you check for these interruption notices every 5 seconds\.
The interruption notice is made available as a CloudWatch event and as an item in the [instance metadata](ec2-instance-metadata.md) on the Spot Instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b22d13a9c40c-0 | When Amazon EC2 is going to interrupt your Spot Instance, it emits an event two minutes prior to the actual interruption \(except for hibernation, which gets the interruption notice, but not two minutes in advance, because hibernation begins immediately\)\. This event can be detected by Amazon CloudWatch Events\. For more information about CloudWatch events, see the [Amazon CloudWatch Events User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/)\. For a detailed example that walks you through how to create and use event rules, see [Taking Advantage of Amazon EC2 Spot Instance Interruption Notices](http://aws.amazon.com/blogs/compute/taking-advantage-of-amazon-ec2-spot-instance-interruption-notices/)\.
The following is an example of the event for Spot Instance interruption\. The possible values for `instance-action` are `hibernate`, `stop`, and `terminate`\.
```
{
"version": "0",
"id": "12345678-1234-1234-1234-123456789012",
"detail-type": "EC2 Spot Instance Interruption Warning",
"source": "aws.ec2",
"account": "123456789012",
"time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-2", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b22d13a9c40c-1 | "time": "yyyy-mm-ddThh:mm:ssZ",
"region": "us-east-2",
"resources": ["arn:aws:ec2:us-east-2:123456789012:instance/i-1234567890abcdef0"],
"detail": {
"instance-id": "i-1234567890abcdef0",
"instance-action": "action"
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
b007cc4a4273-0 | If your Spot Instance is marked to be stopped or terminated by the Spot service, the `instance-action` item is present in your [instance metadata](ec2-instance-metadata.md)\. Otherwise, it is not present\. You can retrieve `instance-action` as follows\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
2a90432eacb0-0 | ```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" –v http://169.254.169.254/latest/meta-data/spot/instance-action
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
6e6c99bc8d04-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/spot/instance-action
```
------
The `instance-action` item specifies the action and the approximate time, in UTC, when the action will occur\.
The following example indicates the time at which this instance will be stopped\.
```
{"action": "stop", "time": "2017-09-18T08:22:00Z"}
```
The following example indicates the time at which this instance will be terminated\.
```
{"action": "terminate", "time": "2017-09-18T08:22:00Z"}
```
If Amazon EC2 is not preparing to stop or terminate the instance, or if you terminated the instance yourself, `instance-action` is not present and you receive an HTTP 404 error when you try to retrieve it\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
d51b6c172201-0 | This item is maintained for backward compatibility; you should use `instance-action` instead\.
If your Spot Instance is marked for termination by the Spot service, the `termination-time` item is present in your instance metadata\. Otherwise, it is not present\. You can retrieve `termination-time` as follows\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
0fa9c4c3e293-0 | ```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
[ec2-user ~]$ if curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/spot/termination-time | grep -q .*T.*Z; then echo terminated; fi
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
dd0ad9b73da3-0 | ```
[ec2-user ~]$ if curl -s http://169.254.169.254/latest/meta-data/spot/termination-time | grep -q .*T.*Z; then echo terminated; fi
```
------
The `termination-time` item specifies the approximate time in UTC when the instance receives the shutdown signal\. For example:
```
2015-01-05T18:02:00Z
```
If Amazon EC2 is not preparing to terminate the instance, or if you terminated the Spot Instance yourself, the `termination-time` item is either not present \(so you receive an HTTP 404 error\) or contains a value that is not a time value\.
If Amazon EC2 fails to terminate the instance, the request status is set to `fulfilled`\. The `termination-time` value remains in the instance metadata with the original approximate time, which is now in the past\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
8e38391d0819-0 | In the console, the **Instances** pane displays all instances, including Spot Instances\. You can identify a Spot Instance from the `spot` value in the **Lifecycle** column\. The **Instance State** column indicates whether the instance is `pending`, `running`, `stopping`, `stopped`, `shutting-down`, or `terminated`\. For a hibernated Spot Instance, the instance state is `stopped`\.
**To find an interrupted Spot Instance \(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**\. In the top right corner, choose the **Show/Hide Columns** icon, and under **Instance Attributes**, select **Lifecycle**\. For Spot Instances, **Lifecycle** is `spot`\.
Alternatively, in the navigation pane, choose **Spot Requests**\. You can see both Spot Instance requests and Spot Fleet requests\. To view the IDs of the instances, select a Spot Instance request or a Spot Fleet request and choose the **Instances** tab\. Choose an instance ID to display the instance in the **Instances** pane\.
1. For each Spot Instance, you can view its state in the **Instance State** column\.
**To find interrupted Spot Instances \(AWS CLI\)** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
8e38391d0819-1 | **To find interrupted Spot Instances \(AWS CLI\)**
You can list your interrupted Spot Instances using the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command with the `--filters` parameter\. To list only the instance IDs in the output, add the `--query` parameter\.
```
aws ec2 describe-instances \
--filters Name=instance-lifecycle,Values=spot Name=instance-state-name,Values=terminated,stopped \
--query Reservations[*].Instances[*].InstanceId
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
c59cb154dc37-0 | If a Spot Instance is stopped, hibernated, or terminated, you can use CloudTrail to see whether Amazon EC2 interrupted the Spot Instance\. In CloudTrail, the event name `BidEvictedEvent` indicates that Amazon EC2 interrupted the Spot Instance\. For more information about using CloudTrail, see [Logging Amazon EC2 and Amazon EBS API calls with AWS CloudTrail](monitor-with-cloudtrail.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
64d9fa89c4f4-0 | When a Spot Instance \(*not* in a Spot block\) is interrupted, you’re charged as follows\.
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html)
When a Spot Instance *in a Spot block* is interrupted, you’re charged as follows\.
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-interruptions.md |
ab06fa0f2018-0 | Each Linux instance launches with a default Linux system user account\. The default user name is determined by the AMI that was specified when you launched the instance\.
+ For Amazon Linux 2 or the Amazon Linux AMI, the user name is `ec2-user`\.
+ For a CentOS AMI, the user name is `centos`\.
+ For a Debian AMI, the user name is `admin`\.
+ For a Fedora AMI, the user name is `ec2-user` or `fedora`\.
+ For a RHEL AMI, the user name is `ec2-user` or `root`\.
+ For a SUSE AMI, the user name is `ec2-user` or `root`\.
+ For an Ubuntu AMI, the user name is `ubuntu`\.
+ Otherwise, if `ec2-user` and `root` don't work, check with the AMI provider\.
**Note**
Linux system users should not be confused with AWS Identity and Access Management \(IAM\) users\. For more information, see [IAM Users and Groups](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_WorkingWithGroupsAndUsers.html) in the *IAM User Guide*\.
**Topics**
+ [Considerations](#add-user-best-practice)
+ [Creating a user account](#create-user-account)
+ [Removing a user account](#delete-user-acount) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
7eba78775670-0 | Using the default user account is adequate for many applications\. However, you may choose to add user accounts so that individuals can have their own files and workspaces\. Furthermore, creating user accounts for new users is much more secure than granting multiple \(possibly inexperienced\) users access to the default user account, because the default user account can cause a lot of damage to a system when used improperly\. For more information, see [Tips for Securing Your EC2 Instance](http://aws.amazon.com/articles/tips-for-securing-your-ec2-instance/)\.
To enable users SSH access to your EC2 instance using a Linux system user account, you must share the SSH key with the user\. Alternatively, you can use EC2 Instance Connect to provide access to users without the need to share and manage SSH keys\. For more information, see [Connecting to your Linux instance using EC2 Instance Connect](Connect-using-EC2-Instance-Connect.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
cddfbe757c6c-0 | First create the user account, and then add the SSH public key that allows the user to connect to and log into the instance\.
**To create a user account**
1. [Create a new key pair](ec2-key-pairs.md#having-ec2-create-your-key-pair)\. You must provide the `.pem` file to the user for whom you are creating the user account\. They must use this file to connect to the instance\.
1. Retrieve the public key from the key pair that you created in the previous step\.
```
$ ssh-keygen -y -f /path_to_key_pair/key-pair-name.pem
```
The command returns the public key, as shown in the following example\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
cddfbe757c6c-1 | ```
The command returns the public key, as shown in the following example\.
```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClKsfkNkuSevGj3eYhCe53pcjqP3maAhDFcvBS7O6Vhz2ItxCih+PnDSUaw+WNQn/mZphTk/a/gU8jEzoOWbkM4yxyb/wB96xbiFveSFJuOp/d6RJhJOI0iBXrlsLnBItntckiJ7FbtxJMXLvvwJryDUilBMTjYtwB+QhYXUMOzce5Pjz5/i8SeJtjnV3iAoG/cQk+0FzZqaeJAAHco+CY/5WrUBkrHmFJr6HcXkvJdWPkYQS3xqC0+FmUZofz221CBt5IMucxXPkX4rWi+z7wB3RbBQoQzd8v7yeb7OzlPnWOyN0qFU0XA246RA8QFYiCNYwI3f05p6KLxEXAMPLE
```
1. Connect to the instance\.
1. Use the adduser command to create the user account and add it to the system \(with an entry in the `/etc/passwd` file\)\. The command also creates a group and a home directory for the account\. In this example, the user account is named `newuser`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
cddfbe757c6c-2 | + Amazon Linux and Amazon Linux 2
```
[ec2-user ~]$ sudo adduser newuser
```
+ Ubuntu
Include the `--disabled-password` parameter to create the user account without a password\.
```
[ubuntu ~]$ sudo adduser newuser --disabled-password
```
1. Switch to the new account so that the directory and file that you create will have the proper ownership\.
```
[ec2-user ~]$ sudo su - newuser
```
The prompt changes from `ec2-user` to `newuser` to indicate that you have switched the shell session to the new account\.
1. Add the SSH public key to the user account\. First create a directory in the user's home directory for the SSH key file, then create the key file, and finally paste the public key into the key file, as described in the following sub\-steps\.
1. Create a `.ssh` directory in the `newuser` home directory and change its file permissions to `700` \(only the owner can read, write, or open the directory\)\.
```
[newuser ~]$ mkdir .ssh
```
```
[newuser ~]$ chmod 700 .ssh
```
**Important** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
cddfbe757c6c-3 | ```
[newuser ~]$ chmod 700 .ssh
```
**Important**
Without these exact file permissions, the user will not be able to log in\.
1. Create a file named `authorized_keys` in the `.ssh` directory and change its file permissions to `600` \(only the owner can read or write to the file\)\.
```
[newuser ~]$ touch .ssh/authorized_keys
```
```
[newuser ~]$ chmod 600 .ssh/authorized_keys
```
**Important**
Without these exact file permissions, the user will not be able to log in\.
1. <a name="edit_auth_keys"></a>Open the `authorized_keys` file using your favorite text editor \(such as **vim** or **nano**\)\.
```
[newuser ~]$ nano .ssh/authorized_keys
```
Paste the public key that you retrieved in **Step 2** into the file and save the changes\.
**Important**
Ensure that you paste the public key in one continuous line\. The public key must not be split over multiple lines\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
cddfbe757c6c-4 | **Important**
Ensure that you paste the public key in one continuous line\. The public key must not be split over multiple lines\.
The user should now be able to log into the `newuser` account on your instance, using the private key that corresponds to the public key that you added to the `authorized_keys` file\. For more information about the different methods of connecting to a Linux instance, see [Connect to your Linux instance](AccessingInstances.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
4d300d8209f6-0 | If a user account is no longer needed, you can remove that account so that it can no longer be used\.
Use the userdel command to remove the user account from the system\. When you specify the `-r` parameter, the user's home directory and mail spool are deleted\. To keep the user's home directory and mail spool, omit the `-r` parameter\.
```
[ec2-user ~]$ sudo userdel -r olduser
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/managing-users.md |
80afec74ad81-0 | The AWS global infrastructure is built around AWS Regions and Availability Zones\. Regions provide multiple physically separated and isolated Availability Zones, which are connected through low\-latency, high\-throughput, and highly redundant networking\. With Availability Zones, you can design and operate applications and databases that automatically fail over between zones without interruption\. Availability Zones are more highly available, fault tolerant, and scalable than traditional single or multiple data center infrastructures\.
If you need to replicate your data or applications over greater geographic distances, use AWS Local Zones\. An AWS Local Zone is an extension of an AWS Region in geographic proximity to your users\. Local Zones have their own connections to the internet and support AWS Direct Connect\. Like all AWS Regions, AWS Local Zones are completely isolated from other AWS Zones\.
If you need to replicate your data or applications in an AWS Local Zone, AWS recommends that you use one of the following zones as the failover zone:
+ Another Local Zone
+ An Availability Zone in the Region that is not the parent zone\. You can use the [describe\-availability\-zones](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-availability-zones.html) command to view the parent zone\.
For more information about AWS Regions and Availability Zones, see [AWS Global Infrastructure](http://aws.amazon.com/about-aws/global-infrastructure/)\.
In addition to the AWS global infrastructure, Amazon EC2 offers the following features to support your data resiliency:
+ Copying AMIs across Regions
+ Copying EBS snapshots across Regions | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/disaster-recovery-resiliency.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.