id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
80afec74ad81-1
+ Copying AMIs across Regions + Copying EBS snapshots across Regions + Automating EBS snapshots using Amazon Data Lifecycle Manager + Maintaining the health and availability of your fleet using Amazon EC2 Auto Scaling + Distributing incoming traffic across multiple instances in a single Availability Zone or multiple Availability Zones using Elastic Load Balancing
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/disaster-recovery-resiliency.md
4fc3410fde42-0
To ensure the best IOPS performance from your SSD instance store volumes on Linux, we recommend that you use the most recent version of Amazon Linux, or another Linux AMI with a kernel version of 3\.8 or later\. If you do not use a Linux AMI with a kernel version of 3\.8 or later, your instance won't achieve the maximum IOPS performance available for these instance types\. Like other instance store volumes, you must map the SSD instance store volumes for your instance when you launch it\. The data on an SSD instance volume persists only for the life of its associated instance\. For more information, see [Add instance store volumes to your EC2 instance](add-instance-store-volumes.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ssd-instance-store.md
240539d30b1c-0
The following instances offer non\-volatile memory express \(NVMe\) solid state drives \(SSD\) instance store volumes: C5d, G4, I3, I3en, F1, M5ad, M5d, `p3dn.24xlarge`, R5ad, R5d, and z1d\. To access NVMe volumes, the [NVMe drivers](nvme-ebs-volumes.md#install-nvme-driver) must be installed\. The following AMIs meet this requirement: + Amazon Linux 2 + Amazon Linux AMI 2018\.03 + Ubuntu 14\.04 \(with `linux-aws` kernel\) or later + Red Hat Enterprise Linux 7\.4 or later + SUSE Linux Enterprise Server 12 SP2 or later + CentOS 7\.4\.1708 or later + FreeBSD 11\.1 or later + Debian GNU/Linux 9 or later After you connect to your instance, you can list the NVMe devices using the lspci command\. The following is example output for an `i3.8xlarge` instance, which supports four NVMe devices\. ``` [ec2-user ~]$ lspci 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ssd-instance-store.md
240539d30b1c-1
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01) 00:02.0 VGA compatible controller: Cirrus Logic GD 5446 00:03.0 Ethernet controller: Device 1d0f:ec20 00:17.0 Non-Volatile memory controller: Device 1d0f:cd01 00:18.0 Non-Volatile memory controller: Device 1d0f:cd01 00:19.0 Non-Volatile memory controller: Device 1d0f:cd01 00:1a.0 Non-Volatile memory controller: Device 1d0f:cd01 00:1f.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01) ``` If you are using a supported operating system but you do not see the NVMe devices, verify that the NVMe module is loaded using the following command\. + Amazon Linux, Amazon Linux 2, Ubuntu 14/16, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, CentOS 7 ``` $ lsmod | grep nvme nvme 48813 0 ``` + Ubuntu 18 ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ssd-instance-store.md
240539d30b1c-2
nvme 48813 0 ``` + Ubuntu 18 ``` $ cat /lib/modules/$(uname -r)/modules.builtin | grep nvme s/nvme/host/nvme-core.ko kernel/drivers/nvme/host/nvme.ko kernel/drivers/nvmem/nvmem_core.ko ``` The NVMe volumes are compliant with the NVMe 1\.0e specification\. You can use the NVMe commands with your NVMe volumes\. With Amazon Linux, you can install the `nvme-cli` package from the repo using the yum install command\. With other supported versions of Linux, you can download the `nvme-cli` package if it's not available in the image\. The data on NVMe instance storage is encrypted using an XTS\-AES\-256 block cipher implemented in a hardware module on the instance\. The encryption keys are generated using the hardware module and are unique to each NVMe instance storage device\. All encryption keys are destroyed when the instance is stopped or terminated and cannot be recovered\. You cannot disable this encryption and you cannot provide your own encryption key\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ssd-instance-store.md
e9552f103767-0
The following instances support instance store volumes that use non\-NVMe SSDs to deliver high random I/O performance: C3, G2, I2, M3, R3, and X1\. For more information about the instance store volumes support by each instance type, see [Instance store volumes](InstanceStorage.md#instance-store-volumes)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ssd-instance-store.md
44b667b92e3c-0
The following instances support SSD volumes with TRIM: C5d, F1, G4, I2, I3, I3en, M5ad, M5d, `p3dn.24xlarge`, R3, R5ad, R5d, and z1d\. Instance store volumes that support TRIM are fully trimmed before they are allocated to your instance\. These volumes are not formatted with a file system when an instance launches, so you must format them before they can be mounted and used\. For faster access to these volumes, you should skip the TRIM operation when you format them\. With instance store volumes that support TRIM, you can use the TRIM command to notify the SSD controller when you no longer need data that you've written\. This provides the controller with more free space, which can reduce write amplification and increase performance\. On Linux, use the `fstrim` command to enable periodic TRIM\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ssd-instance-store.md
8b642a5f97ca-0
Kernel Live Patching for Amazon Linux 2 enables you to apply security vulnerability and critical bug patches to a running Linux kernel, without reboots or disruptions to running applications\. This allows you to benefit from improved service and application availability, while keeping your infrastructure secure and up to date\. AWS releases two types of kernel live patches for Amazon Linux 2: + **Security updates**—Include updates for Linux common vulnerabilities and exposures \(CVE\)\. These updates are typically rated as *important* or *critical* using the Amazon Linux Security Advisory ratings\. They generally map to a Common Vulnerability Scoring System \(CVSS\) score of 7 and higher\. In some cases, AWS might provide updates before a CVE is assigned\. In these cases, the patches might appear as bug fixes\. + **Bug fixes**—Include fixes for critical bugs and stability issues that are not associated with CVEs\. AWS provides kernel live patches for an Amazon Linux 2 kernel version for up to 3 months after its release\. After the 3\-month period, you must update to a later kernel version to continue to receive kernel live patches\. Amazon Linux 2 kernel live patches are made available as signed RPM packages in the existing Amazon Linux 2 repositories\. The patches can be installed on individual instances using existing **yum** workflows, or they can be installed on a group of managed instances using AWS Systems Manager\. Kernel Live Patching on Amazon Linux 2 is provided at no additional cost\. **Topics** + [Supported configurations and prerequisites](#al2-live-patching-prereq)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
8b642a5f97ca-1
**Topics** + [Supported configurations and prerequisites](#al2-live-patching-prereq) + [Working with Kernel Live Patching](#working-with-live-patching) + [Limitations](#al2-live-patching-limitations) + [Frequently asked questions](#al2-live-patching-faq)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
4fce9f35245b-0
Kernel Live Patching is supported on Amazon EC2 instances and [on\-premises virtual machines](amazon-linux-2-virtual-machine.md) running Amazon Linux 2\. To use Kernel Live Patching on Amazon Linux 2, you must use: + A 64\-bit \(x86\_64\) architecture that is supported by Amazon Linux 2 + Amazon Linux 2 with kernel version `4.14.165-131.185` or later **Note** The 64\-bit ARM \(arm64\) architecture is not supported\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
e9e6e7bdb8a3-0
You can enable and use Kernel Live Patching on individual instances using the command line on the instance itself, or you can enable and use Kernel Live Patching on a group of managed instances using AWS Systems Manager\. The following sections explain how to enable and use Kernel Live Patching on individual instances using the command line\. For more information about enabling and using Kernel Live Patching on a group of managed instances, see [Use Kernel Live Patching on Amazon Linux 2 instances](https://docs.aws.amazon.com/systems-manager/latest/userguide/kernel-live-patching.html) in the *AWS Systems Manager User Guide*\. **Topics** + [Enabling Kernel Live Patching](#al2-live-patching-enable) + [Viewing the available kernel live patches](#al2-live-patching-view-available) + [Applying kernel live patches](#al2-live-patching-apply) + [View the applied kernel live patches](#al2-live-patching-view) + [Disabling Kernel Live Patching](#al2-live-patching-disable)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
ac8ce853484b-0
Kernel Live Patching is disabled by default on Amazon Linux 2\. To use live patching, you must install the **yum** plugin for Kernel Live Patching and enable the live patching functionality\. **Prerequisites** Kernel Live Patching requires `binutils`\. If you do not have `binutils` installed, install it using the following command: ``` $ sudo yum install binutils ``` **To enable Kernel Live Patching** 1. Kernel live patches are available for Amazon Linux 2 with kernel version `4.14.165-131.185` or later\. To check your kernel version, run the following command\. ``` $ sudo yum list kernel ``` 1. If you already have a supported kernel version, skip this step\. If you do not have a supported kernel version, run the following commands to update the kernel to the latest version and to reboot the instance\. ``` $ sudo yum install -y kernel ``` ``` $ sudo reboot ``` 1. Install the **yum** plugin for Kernel Live Patching\. ``` $ sudo yum install -y yum-plugin-kernel-livepatch ``` 1. Enable the **yum** plugin for Kernel Live Patching\. ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
ac8ce853484b-1
``` 1. Enable the **yum** plugin for Kernel Live Patching\. ``` $ sudo yum kernel-livepatch enable -y ``` This command also installs the latest version of the kernel live patch RPM from the configured repositories\. 1. To confirm that the **yum** plugin for kernel live patching has installed successfully, run the following command\. ``` $ rpm -qa | grep kernel-livepatch ``` When you enable Kernel Live Patching, an empty kernel live patch RPM is automatically applied\. If Kernel Live Patching was successfully enabled, this command returns a list that includes the initial empty kernel live patch RPM\. 1. Update and start the **kpatch** service\. This service loads all of the kernel live patches upon initialization or at boot\. ``` $ sudo yum update kpatch-runtime ``` ``` $ sudo systemctl enable kpatch.service ``` 1. Configure the Amazon Linux 2 Kernel Live Patching repository, which contains the kernel live patches\. ``` $ sudo amazon-linux-extras enable livepatch ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
5eedd4342aa5-0
Amazon Linux security alerts are published to the Amazon Linux Security Center\. For more information about the Amazon Linux 2 security alerts, which include alerts for kernel live patches, see the [Amazon Linux Security Center](https://alas.aws.amazon.com/alas2.html)\. Kernel live patches are prefixed with `ALASLIVEPATCH`\. The Amazon Linux Security Center might not list kernel live patches that address bugs\. You can also discover the available kernel live patches for advisories and CVEs using the command line\. **To list all available kernel live patches for advisories** Use the following command\. ``` $ yum updateinfo list ``` The following shows example output\. ``` Loaded plugins: extras_suggestions, kernel-livepatch, langpacks, priorities, update-motd ALAS2LIVEPATCH-2020-002 important/Sec. kernel-livepatch-4.14.165-133.209-1.0-3.amzn2.x86_64 ALAS2LIVEPATCH-2020-005 medium/Sec. kernel-livepatch-4.14.165-133.209-1.0-4.amzn2.x86_64 updateinfo list done ``` **To list all available kernel live patches for CVEs** Use the following command\. ``` $ yum updateinfo list cves ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
5eedd4342aa5-1
Use the following command\. ``` $ yum updateinfo list cves ``` The following shows example output\. ``` Loaded plugins: extras_suggestions, kernel-livepatch, langpacks, priorities, update-motdamzn2-core/2/x86_64 | 2.4 kB 00:00:00 CVE-2019-15918 important/Sec. kernel-livepatch-4.14.165-133.209-1.0-3.amzn2.x86_64 CVE-2019-20096 important/Sec. kernel-livepatch-4.14.165-133.209-1.0-3.amzn2.x86_64 CVE-2020-8648 medium/Sec. kernel-livepatch-4.14.165-133.209-1.0-4.amzn2.x86_64 updateinfo list done ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
08e7228ffbf0-0
You apply kernel live patches using the **yum** package manager in the same way that you would apply regular updates\. The **yum** plugin for Kernel Live Patching manages the kernel live patches that are to be applied and eliminates the need to reboot\. **Tip** We recommend that you update your kernel regularly using Kernel Live Patching to ensure that it remains secure and up to date\. You can choose to apply a specific kernel live patch, or to apply any available kernel live patches along with your regular security updates\. **To apply a specific kernel live patch** 1. Get the kernel live patch version using one of the commands described in [Viewing the available kernel live patches](#al2-live-patching-view-available)\. 1. Apply the kernel live patch for your Amazon Linux 2 kernel\. ``` $ sudo yum install kernel-livepatch-kernel_version.x86_64 ``` For example, the following command applies a kernel live patch for Amazon Linux 2 kernel version `4.14.165-133.209`\. ``` $ sudo yum install kernel-livepatch-4.14.165-133.209-1.0-4.amzn2.x86_64 ``` **To apply any available kernel live patches along with your regular security updates** Use the following command\. ``` $ sudo yum update --security ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
08e7228ffbf0-1
Use the following command\. ``` $ sudo yum update --security ``` Omit the `--security` option to include bug fixes\. **Important** The kernel version is not updated after applying kernel live patches\. The version is only updated to the new version after the instance is rebooted\. An Amazon Linux 2 kernel receives kernel live patches for a period of three months\. After the three month period has lapsed, no new kernel live patches are released for that kernel version\. To continue to receive kernel live patches after the three\-month period, you must reboot the instance to move to the new kernel version, which will then continue receiving kernel live patches for the next three months\. To check the support window for your kernel version, run `yum kernel-livepatch supported`\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
129555ef349d-0
**To view the applied kernel live patches** Use the following command\. ``` $ kpatch list ``` The command returns a list of the loaded and installed security update kernel live patches\. The following is example output\. ``` Loaded patch modules: livepatch_cifs_lease_buffer_len [enabled] livepatch_CVE_2019_20096 [enabled] livepatch_CVE_2020_8648 [enabled] Installed patch modules: livepatch_cifs_lease_buffer_len (4.14.165-133.209.amzn2.x86_64) livepatch_CVE_2019_20096 (4.14.165-133.209.amzn2.x86_64) livepatch_CVE_2020_8648 (4.14.165-133.209.amzn2.x86_64) ``` **Note** A single kernel live patch can include and install multiple live patches\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
c1b658f98158-0
If you no longer need to use Kernel Live Patching, you can disable it at any time\. **To disable Kernel Live Patching** 1. Remove the RPM packages for the applied kernel live patches\. ``` $ sudo yum kernel-livepatch disable ``` 1. Uninstall the **yum** plugin for Kernel Live Patching\. ``` $ sudo yum remove yum-plugin-kernel-livepatch ``` 1. Reboot the instance\. ``` $ sudo reboot ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
a72c3b70b6e1-0
Kernel Live Patching has the following limitations: + While applying a kernel live patch, you can't perform hibernation, use advanced debugging tools \(such as SystemTap, kprobes, and eBPF\-based tools\), or access ftrace output files used by the Kernel Live Patching infrastructure\. + Amazon Linux 2 instances with 64\-bit ARM \(arm64\) architecture are not supported\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
07d72af8e1d0-0
For frequently asked questions about Kernel Live Patching for Amazon Linux 2, see the [Amazon Linux 2 Kernel Live Patching FAQ](http://aws.amazon.com/amazon-linux-2/faqs/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/al2-live-patching.md
90abf7e25d3f-0
Complete the tasks in this section to get set up for launching an Amazon EC2 instance for the first time: 1. [Sign up for AWS](#sign-up-for-aws) 1. [Create a key pair](#create-a-key-pair) 1. [Create a security group](#create-a-base-security-group) When you are finished, you will be ready for the [Amazon EC2 Getting started](EC2_GetStarted.md) tutorial\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
22a2e2730320-0
When you sign up for Amazon Web Services \(AWS\), your AWS account is automatically signed up for all services in AWS, including Amazon EC2\. You are charged only for the services that you use\. With Amazon EC2, you pay only for what you use\. If you are a new AWS customer, you can get started with Amazon EC2 for free\. For more information, see [AWS Free Tier](https://aws.amazon.com/free/)\. If you have an AWS account already, skip to the next task\. If you don't have an AWS account, use the following procedure to create one\. **To create an AWS account** 1. Open [https://portal\.aws\.amazon\.com/billing/signup](https://portal.aws.amazon.com/billing/signup)\. 1. Follow the online instructions\. Part of the sign\-up procedure involves receiving a phone call and entering a verification code on the phone keypad\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
a6b759a844a4-0
AWS uses public\-key cryptography to secure the login information for your instance\. A Linux instance has no password; you use a key pair to log in to your instance securely\. You specify the name of the key pair when you launch your instance, then provide the private key when you log in using SSH\. If you haven't created a key pair already, you can create one using the Amazon EC2 console\. Note that if you plan to launch instances in multiple Regions, you'll need to create a key pair in each Region\. For more information about Regions, see [Regions and Zones](using-regions-availability-zones.md)\. You can create a key pair using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
f0fcf34be8ba-0
**To create your key pair** 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 **Key Pairs**\. 1. Choose **Create key pair**\. 1. For **Name**, enter a descriptive name for the key pair\. Amazon EC2 associates the public key with the name that you specify as the key name\. A key name can include up to 255 ASCII characters\. It can’t include leading or trailing spaces\. 1. For **File format**, choose the format in which to save the private key\. To save the private key in a format that can be used with OpenSSH, choose **pem**\. To save the private key in a format that can be used with PuTTY, choose **ppk**\. 1. Choose **Create key pair**\. 1. The private key file is automatically downloaded by your browser\. The base file name is the name you specified as the name of your key pair, and the file name extension is determined by the file format you chose\. Save the private key file in a safe place\. **Important** This is the only chance for you to save the private key file\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
f0fcf34be8ba-1
**Important** This is the only chance for you to save the private key file\. 1. If you will use an SSH client on a macOS or Linux computer to connect to your Linux instance, use the following command to set the permissions of your private key file so that only you can read it\. ``` chmod 400 my-key-pair.pem ``` If you do not set these permissions, then you cannot connect to your instance using this key pair\. For more information, see [Error: Unprotected private key file](TroubleshootingInstancesConnecting.md#troubleshoot-unprotected-key)\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
874b4421e33d-0
**To create your key pair** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, under **NETWORK & SECURITY**, choose **Key Pairs**\. **Note** The navigation pane is on the left side of the Amazon EC2 console\. If you do not see the pane, it might be minimized; choose the arrow to expand the pane\. 1. Choose **Create Key Pair**\. 1. For **Key pair name**, enter a name for the new key pair, and then choose **Create**\. The name can include up to 255 ASCII characters\. It can’t include leading or trailing spaces\. 1. The private key file is automatically downloaded by your browser\. The base file name is the name you specified as the name of your key pair, and the file name extension is `.pem`\. Save the private key file in a safe place\. **Important** This is the only chance for you to save the private key file\. 1. If you will use an SSH client on a macOS or Linux computer to connect to your Linux instance, use the following command to set the permissions of your private key file so that only you can read it\. ``` chmod 400 my-key-pair.pem ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
874b4421e33d-1
``` chmod 400 my-key-pair.pem ``` If you do not set these permissions, then you cannot connect to your instance using this key pair\. For more information, see [Error: Unprotected private key file](TroubleshootingInstancesConnecting.md#troubleshoot-unprotected-key)\. ------ For more information, see [Amazon EC2 key pairs and Linux instances](ec2-key-pairs.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
c6a38fd0d871-0
Security groups act as a firewall for associated instances, controlling both inbound and outbound traffic at the instance level\. You must add rules to a security group that enable you to connect to your instance from your IP address using SSH\. You can also add rules that allow inbound and outbound HTTP and HTTPS access from anywhere\. Note that if you plan to launch instances in multiple Regions, you'll need to create a security group in each Region\. For more information about Regions, see [Regions and Zones](using-regions-availability-zones.md)\. **Prerequisites** You'll need the public IPv4 address of your local computer\. The security group editor in the Amazon EC2 console can automatically detect the public IPv4 address for you\. Alternatively, you can use the search phrase "what is my IP address" in an Internet browser, or use the following service: [Check IP](http://checkip.amazonaws.com/)\. If you are connecting through an Internet service provider \(ISP\) or from behind a firewall without a static IP address, you need to find out the range of IP addresses used by client computers\. You can create a custom security group using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
2b98c2ae2ea3-0
**To create a security group with least privilege** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. From the navigation bar, select a Region for the security group\. Security groups are specific to a Region, so you should select the same Region in which you created your key pair\. 1. In the navigation pane, choose **Security Groups**\. 1. Choose **Create security group**\. 1. In the **Basic details** section, do the following: 1. Enter a name for the new security group and a description\. Use a name that is easy for you to remember, such as your user name, followed by \_SG\_, plus the Region name\. For example, *me*\_SG\_*uswest2*\. 1. In the **VPC** list, select your default VPC for the Region\. 1. In the **Inbound rules** section, create the following rules \(choose **Add rule** for each new rule\): + Choose **HTTP** from the **Type** list, and make sure that **Source** is set to **Anywhere** \(`0.0.0.0/0`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
2b98c2ae2ea3-1
+ Choose **HTTPS** from the **Type** list, and make sure that **Source** is set to **Anywhere** \(`0.0.0.0/0`\)\. + Choose **SSH** from the **Type** list\. In the **Source** box, choose **My IP** to automatically populate the field with the public IPv4 address of your local computer\. Alternatively, choose **Custom** and specify the public IPv4 address of your computer or network in CIDR notation\. To specify an individual IP address in CIDR notation, add the routing suffix `/32`, for example, `203.0.113.25/32`\. If your company allocates addresses from a range, specify the entire range, such as `203.0.113.0/24`\. **Warning** For security reasons, we don't recommend that you allow SSH access from all IPv4 addresses \(`0.0.0.0/0`\) to your instance, except for testing purposes and only for a short time\. 1. Choose **Create security group**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
ab78047ded54-0
**To create a security group with least privilege** 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. Choose **Create Security Group**\. 1. Enter a name for the new security group and a description\. Use a name that is easy for you to remember, such as your user name, followed by \_SG\_, plus the Region name\. For example, *me*\_SG\_*uswest2*\. 1. In the **VPC** list, select your default VPC for the Region\. 1. On the **Inbound** tab, create the following rules \(choose **Add rule** for each new rule\): + Choose **HTTP** from the **Type** list, and make sure that **Source** is set to **Anywhere** \(`0.0.0.0/0`\)\. + Choose **HTTPS** from the **Type** list, and make sure that **Source** is set to **Anywhere** \(`0.0.0.0/0`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
ab78047ded54-1
+ Choose **SSH** from the **Type** list\. In the **Source** box, choose **My IP** to automatically populate the field with the public IPv4 address of your local computer\. Alternatively, choose **Custom** and specify the public IPv4 address of your computer or network in CIDR notation\. To specify an individual IP address in CIDR notation, add the routing suffix `/32`, for example, `203.0.113.25/32`\. If your company allocates addresses from a range, specify the entire range, such as `203.0.113.0/24`\. **Warning** For security reasons, we don't recommend that you allow SSH access from all IPv4 addresses \(`0.0.0.0/0`\) to your instance, except for testing purposes and only for a short time\. 1. Choose **Create**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
533967d60c16-0
**To create a security group with least privilege** 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\) ------ For more information, see [Amazon EC2 security groups for Linux instances](ec2-security-groups.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/get-set-up-for-amazon-ec2.md
5aed74b4ac28-0
Amazon CloudWatch Events enables you to automate your AWS services and respond automatically to system events such as application availability issues or resource changes\. Events from AWS services are delivered to CloudWatch Events in near real time\. You can write simple rules to indicate which events are of interest to you, and the automated actions to take when an event matches a rule\. The actions that can be automatically triggered include the following: + Invoking an AWS Lambda function + Invoking Amazon EC2 Run Command + Relaying the event to Amazon Kinesis Data Streams + Activating an AWS Step Functions state machine + Notifying an Amazon SNS topic or an Amazon SQS queue Some examples of using CloudWatch Events with Amazon EC2 include: + Activating a Lambda function whenever a new Amazon EC2 instance starts\. + Notifying an Amazon SNS topic when an Amazon EBS volume is created or modified\. + Sending a command to one or more Amazon EC2 instances using Amazon EC2 Run Command whenever a certain event in another AWS service occurs\. For more information, see the [Amazon CloudWatch Events User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/automating_with_cloudwatch_events.md
65094c67f4e9-0
A requester\-managed network interface is a network interface that an AWS service creates in your VPC\. This network interface can represent an instance for another service, such as an Amazon RDS instance, or it can enable you to access another service or resource, such as an AWS PrivateLink service, or an Amazon ECS task\. You cannot modify or detach a requester\-managed network interface\. If you delete the resource that the network interface represents, the AWS service detaches and deletes the network interface for you\. To change the security groups for a requester\-managed network interface, you might have to use the console or command line tools for that service\. For more information, see the service\-specific documentation\. You can tag a requester\-managed network interface\. For more information, see [Adding or editing tags](using-eni.md#eni_add_edit_tags)\. You can view the requester\-managed network interfaces that are in your account\. **To view requester\-managed network interfaces 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 **Network Interfaces**\. 1. Select the network interface and view the following information on the details pane:
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/requester-managed-eni.md
65094c67f4e9-1
1. In the navigation pane, choose **Network Interfaces**\. 1. Select the network interface and view the following information on the details pane: + **Attachment owner**: If you created the network interface, this field displays your AWS account ID\. Otherwise, it displays an alias or ID for the principal or service that created the network interface\. + **Description**: Provides information about the purpose of the network interface; for example, "VPC Endpoint Interface"\. **To view requester\-managed network interfaces using the command line** 1. Use the [describe\-network\-interfaces](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-network-interfaces.html) AWS CLI command to describe the network interfaces in your account\. ``` aws ec2 describe-network-interfaces ``` 1. In the output, the `RequesterManaged` field displays `true` if the network interface is managed by another AWS service\. ``` { "Status": "in-use", ... "Description": "VPC Endpoint Interface vpce-089f2123488812123", "NetworkInterfaceId": "eni-c8fbc27e", "VpcId": "vpc-1a2b3c4d", "PrivateIpAddresses": [ {
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/requester-managed-eni.md
65094c67f4e9-2
"VpcId": "vpc-1a2b3c4d", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-10-0-2-227.ec2.internal", "Primary": true, "PrivateIpAddress": "10.0.2.227" } ], "RequesterManaged": true, ... } ``` Alternatively, use the [Get\-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2NetworkInterface.html) Tools for Windows PowerShell command\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/requester-managed-eni.md
e7405b1f42cc-0
An *Elastic IP address* is a static IPv4 address designed for dynamic cloud computing\. An Elastic IP address is associated with your AWS account\. With an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account\. An Elastic IP address is a public IPv4 address, which is reachable from the internet\. If your instance does not have a public IPv4 address, you can associate an Elastic IP address with your instance to enable communication with the internet\. For example, this allows you to connect to your instance from your local computer\. We currently do not support Elastic IP addresses for IPv6\. **Topics** + [Elastic IP address basics](#eip-basics) + [Working with Elastic IP addresses](#working-with-eips) + [Using reverse DNS for email applications](#Using_Elastic_Addressing_Reverse_DNS) + [Elastic IP address limit](#using-instance-addressing-limit)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
2049eee5e800-0
The following are the basic characteristics of an Elastic IP address: + To use an Elastic IP address, you first allocate one to your account, and then associate it with your instance or a network interface\. + When you associate an Elastic IP address with an instance, it is also associated with the instance's primary network interface\. When you associate an Elastic IP address with a network interface that is attached to an instance, it is also associated with the instance\. + When you associate an Elastic IP address with an instance or its primary network interface, the instance's public IPv4 address \(if it had one\) is released back into Amazon's pool of public IPv4 addresses\. You cannot reuse a public IPv4 address, and you cannot convert a public IPv4 address to an Elastic IP address\. For more information, see [Public IPv4 addresses and external DNS hostnames](using-instance-addressing.md#concepts-public-addresses)\. + You can disassociate an Elastic IP address from a resource, and then associate it with a different resource\. To avoid unexpected behavior, ensure that all active connections to the resource named in the existing association are closed before you make the change\. After you have associated your Elastic IP address to a different resource, you can reopen your connections to the newly associated resource\. + A disassociated Elastic IP address remains allocated to your account until you explicitly release it\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
2049eee5e800-1
+ A disassociated Elastic IP address remains allocated to your account until you explicitly release it\. + To ensure efficient use of Elastic IP addresses, we impose a small hourly charge if an Elastic IP address is not associated with a running instance, or if it is associated with a stopped instance or an unattached network interface\. While your instance is running, you are not charged for one Elastic IP address associated with the instance, but you are charged for any additional Elastic IP addresses associated with the instance\. For more information, see the section for Elastic IP Addresses on the [Amazon EC2 Pricing, On\-Demand Pricing page](http://aws.amazon.com/ec2/pricing/on-demand/)\. + An Elastic IP address is for use in a specific network border group only\. + When you associate an Elastic IP address with an instance that previously had a public IPv4 address, the public DNS host name of the instance changes to match the Elastic IP address\. + We resolve a public DNS host name to the public IPv4 address or the Elastic IP address of the instance outside the network of the instance, and to the private IPv4 address of the instance from within the network of the instance\. + When you allocate an Elastic IP address from an IP address pool that you have brought to your AWS account, it does not count toward your Elastic IP address limits\. For more information, see [Elastic IP address limit](#using-instance-addressing-limit)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
2049eee5e800-2
+ When you allocate the Elastic IP addresses, you can associate the Elastic IP addresses with a network border group\. This is the location from which we advertise the CIDR block\. Setting the network border group limits the CIDR block to this group\. If you do not specify the network border group, we set the border group containing all of the Availability Zones in the Region \(for example, `us-west-2`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
972c4bf88f00-0
The following sections describe how you can work with Elastic IP addresses\. **Topics** + [Allocating an Elastic IP address](#using-instance-addressing-eips-allocating) + [Describing your Elastic IP addresses](#using-instance-addressing-eips-describing) + [Tagging an Elastic IP address](#using-instance-addressing-eips-tagging) + [Associating an Elastic IP address with a running instance or network interface](#using-instance-addressing-eips-associating) + [Disassociating an Elastic IP address](#using-instance-addressing-eips-associating-different) + [Releasing an Elastic IP address](#using-instance-addressing-eips-releasing) + [Recovering an Elastic IP address](#using-eip-recovering)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
f69fd43b4e76-0
You can allocate an Elastic IP address from Amazon's pool of public IPv4 addresses, or from a custom IP address pool that you have brought to your AWS account\. For more information about bringing your own IP address range to your AWS account, see [Bring your own IP addresses \(BYOIP\) in Amazon EC2](ec2-byoip.md)\. You can allocate an Elastic IP address using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
440705206f33-0
**To allocate an Elastic IP address** 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 **Elastic IPs**\. 1. Choose **Allocate Elastic IP address**\. 1. For **Scope**, choose either **VPC** or **EC2\-Classic** depending on the scope in which it will be used\. 1. \(VPC scope only\) For **Public IPv4 address pool** choose one of the following: + **Amazon's pool of IP addresses**—If you want an IPv4 address to be allocated from Amazon's pool of IP addresses\. + **My pool of public IPv4 addresses**—If you want to allocate an IPv4 address from an IP address pool that you have brought to your AWS account\. This option is disabled if you do not have any IP address pools\. + **Customer owned pool of IPv4 addresses**—If you want to allocate an IPv4 address from a pool created from your on\-premises network for use with an AWS Outpost\. This option is disabled if you do not have an AWS Outpost\. 1. Choose **Allocate**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
fe04e9cfd1a2-0
**To allocate an Elastic IP address** 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 **Elastic IPs**\. 1. Choose **Allocate new address**\. 1. For **IPv4 address pool**, choose **Amazon pool**\. 1. Choose **Allocate**, and close the confirmation screen\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
af1cc6505054-0
**To allocate an Elastic IP address** Use the [allocate\-address](https://docs.aws.amazon.com/cli/latest/reference/ec2/allocate-address.html) AWS CLI command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
088e07945933-0
**To allocate an Elastic IP address** Use the [New\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Address.html) AWS Tools for Windows PowerShell command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
005a6c2b0a35-0
You can describe an Elastic IP address using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
8ce81009f132-0
**To describe your Elastic IP addresses** 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 **Elastic IPs**\. 1. Select the Elastic IP address to view and choose **Actions**, **View details**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
f50f4991b6eb-0
**To describe your Elastic IP addresses** 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 **Elastic IPs**\. 1. Select a filter from the Resource Attribute list to begin searching\. You can use multiple filters in a single search\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
6f292bcbe9f6-0
**To describe your Elastic IP addresses** Use the [describe\-addresses](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-addresses.html) AWS CLI command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
3d4de9564232-0
**To describe your Elastic IP addresses** Use the [Get\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Address.html) AWS Tools for Windows PowerShell command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
bda833cf68e6-0
You can assign custom tags to your Elastic IP addresses to categorize them in different ways, for example, by purpose, owner, or environment\. This helps you to quickly find a specific Elastic IP address based on the custom tags that you assigned to it\. You can only tag Elastic IP addresses that are in the VPC scope\. **Note** Cost allocation tracking using Elastic IP address tags is not supported\. You can tag an Elastic IP address using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
72899eea4e11-0
**To tag an Elastic IP address** 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 **Elastic IPs**\. 1. Select the Elastic IP address to tag and choose **Actions**, **View details**\. 1. In the **Tags** section, choose **Manage tags**\. 1. Specify a tag key and value pair\. 1. \(Optional\) Choose **Add tag** to add additional tags\. 1. Choose **Save**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
51db19072503-0
**To tag an Elastic IP address** 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 **Elastic IPs**\. 1. Select the Elastic IP address to tag and choose **Tags**\. 1. Choose **Add/Edit Tags**\. 1. In the **Add/Edit Tags** dialog box, choose **Create Tag**, and then specify the key and value for the tag\. 1. \(Optional\) Choose **Create Tag** to add additional tags to the Elastic IP address\. 1. Choose **Save**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
44dff09ce053-0
**To tag an Elastic IP address** Use the [create\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html) AWS CLI command\. ``` aws ec2 create-tags --resources eipalloc-12345678 --tags Key=Owner,Value=TeamA ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
a010c7bc6057-0
**To tag an Elastic IP address** Use the [New\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Tag.html) AWS Tools for Windows PowerShell command\. The `New-EC2Tag` command needs a `Tag` parameter, which specifies the key and value pair to be used for the Elastic IP address tag\. The following commands create the `Tag` parameter\. ``` PS C:\> $tag = New-Object Amazon.EC2.Model.Tag PS C:\> $tag.Key = "Owner" PS C:\> $tag.Value = "TeamA" ``` ``` PS C:\> New-EC2Tag -Resource eipalloc-12345678 -Tag $tag ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
8a09357b19cd-0
If you're associating an Elastic IP address with your instance to enable communication with the internet, you must also ensure that your instance is in a public subnet\. For more information, see [Internet Gateways](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html) in the *Amazon VPC User Guide*\. You can associate an Elastic IP address with an instance or network interface using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
a5157dac822e-0
**To associate an Elastic IP address with an instance** 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 **Elastic IPs**\. 1. Select the Elastic IP address to associate and choose **Actions**, **Associate Elastic IP address**\. 1. For **Resource type**, choose **Instance**\. 1. For instance, choose the instance with which to associate the Elastic IP address\. You can also enter text to search for a specific instance\. 1. \(Optional\) For **Private IP address**, specify a private IP address with which to associate the Elastic IP address\. 1. Choose **Associate**\. **To associate an Elastic IP address with a network interface** 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 **Elastic IPs**\. 1. Select the Elastic IP address to associate and choose **Actions**, **Associate Elastic IP address**\. 1. For **Resource type**, choose **Network interface**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
a5157dac822e-1
1. For **Resource type**, choose **Network interface**\. 1. For **Network interface**, choose the network interface with which to associate the Elastic IP address\. You can also enter text to search for a specific network interface\. 1. \(Optional\) For **Private IP address**, specify a private IP address with which to associate the Elastic IP address\. 1. Choose **Associate**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
f6514d53c92b-0
**To associate an Elastic IP address with an instance** 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 **Elastic IPs**\. 1. Select an Elastic IP address and choose **Actions**, **Associate address**\. 1. Select the instance from **Instance** and then choose **Associate**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
2de5669e3651-0
**To associate an Elastic IP address** Use the [associate\-address](https://docs.aws.amazon.com/cli/latest/reference/ec2/associate-address.html) AWS CLI command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
11e2fc9e41e2-0
**To associate an Elastic IP address** Use the [Register\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2Address.html) AWS Tools for Windows PowerShell command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
0744f355805d-0
You can disassociate an Elastic IP address from an instance or network interface at any time\. After you disassociate the Elastic IP address, you can reassociate it with another resource\. You can disassociate an Elastic IP address using one of the following methods\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
6fb9c037d6f0-0
**To disassociate and reassociate an Elastic IP address** 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 **Elastic IPs**\. 1. Select the Elastic IP address to disassociate, choose **Actions**, **Disassociate Elastic IP address**\. 1. Choose **Disassociate**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
fe72d1930af7-0
**To disassociate and reassociate an Elastic IP address** 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 **Elastic IPs**\. 1. Select the Elastic IP address, choose **Actions**, and then select **Disassociate address**\. 1. Choose **Disassociate address**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
8568d341b404-0
**To disassociate an Elastic IP address** Use the [disassociate\-address](https://docs.aws.amazon.com/cli/latest/reference/ec2/disassociate-address.html) AWS CLI command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
88eebd89e2f9-0
**To disassociate an Elastic IP address** Use the [Unregister\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2Address.html) AWS Tools for Windows PowerShell command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
9e8faed141e9-0
If you no longer need an Elastic IP address, we recommend that you release it using one of the following methods\. The address to release must not be currently associated with an AWS resource, such as an EC2 instance, NAT gateway, or Network Load Balancer\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
047858f2e6ef-0
**To release an Elastic IP address** 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 **Elastic IPs**\. 1. Select the Elastic IP address to release and choose **Actions**, **Release Elastic IP addresses**\. 1. Choose **Release**\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
e046acdb898f-0
**To release an Elastic IP address** 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 **Elastic IPs**\. 1. Select the Elastic IP address, choose **Actions**, and then select **Release addresses**\. Choose **Release** when prompted\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
5b35abeab288-0
**To release an Elastic IP address** Use the [release\-address](https://docs.aws.amazon.com/cli/latest/reference/ec2/release-address.html) AWS CLI command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
3af55599a8d9-0
**To release an Elastic IP address** Use the [Remove\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2Address.html) AWS Tools for Windows PowerShell command\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
1cd6a8fc0ae2-0
If you have released your Elastic IP address, you might be able to recover it\. The following rules apply: + You cannot recover an Elastic IP address if it has been allocated to another AWS account, or if it will result in your exceeding your Elastic IP address limit\. + You cannot recover tags associated with an Elastic IP address\. + You can recover an Elastic IP address using the Amazon EC2 API or a command line tool only\. ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
4cef054443f7-0
**To recover an Elastic IP address** Use the [allocate\-address](https://docs.aws.amazon.com/cli/latest/reference/ec2/allocate-address.html) AWS CLI command and specify the IP address using the `--address` parameter as follows\. ``` aws ec2 allocate-address --domain vpc --address 203.0.113.3 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
2b9061fb150c-0
**To recover an Elastic IP address** Use the [New\-EC2Address](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Address.html) AWS Tools for Windows PowerShell command and specify the IP address using the `-Address` parameter as follows\. ``` PS C:\> New-EC2Address -Address 203.0.113.3 -Domain vpc -Region us-east-1 ``` ------
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
eefd85db5fcf-0
If you intend to send email to third parties from an instance, we suggest that you provision one or more Elastic IP addresses and provide them to AWS\. AWS works with ISPs and internet anti\-spam organizations to reduce the chance that your email sent from these addresses will be flagged as spam\. In addition, assigning a static reverse DNS record to your Elastic IP address that is used to send email can help avoid having email flagged as spam by some anti\-spam organizations\. Note that a corresponding forward DNS record \(record type A\) pointing to your Elastic IP address must exist before we can create your reverse DNS record\. If a reverse DNS record is associated with an Elastic IP address, the Elastic IP address is locked to your account and cannot be released from your account until the record is removed\. To remove email sending limits, or to provide us with your Elastic IP addresses and reverse DNS records, go to the [Request to Remove Email Sending Limitations](https://aws.amazon.com/forms/ec2-email-limit-rdns-request) page\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
c6dfc7ebe2e2-0
By default, all AWS accounts are limited to five \(5\) Elastic IP addresses per Region, because public \(IPv4\) internet addresses are a scarce public resource\. We strongly encourage you to use an Elastic IP address primarily for the ability to remap the address to another instance in the case of instance failure, and to use DNS hostnames for all other inter\-node communication\. **To verify how many Elastic IP addresses are in use** Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/) and choose **Elastic IPs** from the navigation pane\. **To verify your current account limit for Elastic IP addresses** You can verify your limit in either the Amazon EC2 console or the Service Quotas console\. Do one of the following: + Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. Choose **Limits** from the navigation pane, and then enter **IP** in the search field\. The limit is **EC2\-VPC Elastic IPs**\. If you have access to EC2\-Classic, there is an additional limit, **EC2\-Classic Elastic IPs**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
c6dfc7ebe2e2-1
+ Open the Service Quotas console at [https://console\.aws\.amazon\.com/servicequotas/](https://console.aws.amazon.com/servicequotas/)\. On the Dashboard, choose **Amazon Elastic Compute Cloud \(Amazon EC2\)**\. If Amazon Elastic Compute Cloud \(Amazon EC2\) is not listed on the Dashboard, choose **AWS services**, enter **EC2** in the search field, and then choose **Amazon Elastic Compute Cloud \(Amazon EC2\)**\. On the Amazon EC2 service quotas page, enter **IP** in the search field\. The limit is **EC2\-VPC Elastic IPs**\. If you have access to EC2\-Classic, there is an additional limit, **EC2\-Classic Elastic IPs**\. For more information, choose the limit\. If you think your architecture warrants additional Elastic IP addresses, you can request a quota increase directly from the Service Quotas console\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/elastic-ip-addresses-eip.md
da4de42ea446-0
When you create an IAM policy that grants IAM users permission to use EC2 resources, you can include tag information in the `Condition` element of the policy to control access based on tags\. This gives you better control over which EC2 resources a user can modify, use, or delete\. For example, you can create a policy that allows users to terminate an instance but denies the action if the instance has the tag `environment=production`\. To do this, you use the `ec2:ResourceTag` condition key to allow or deny access to the resource based on the tags that are attached to the resource\. ``` "StringEquals": { "ec2:ResourceTag/environment": "production" } ``` To learn whether an Amazon EC2 API action supports controlling access using the `ec2:ResourceTag` condition key, see [Actions, Resources, and Condition Keys for Amazon EC2](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonec2.html) in the *IAM User Guide*\. Note that the `Describe` actions do not support resource\-level permissions, and therefore you must specify them in a separate statement without conditions\. For example IAM policies, see [Example policies for working with the AWS CLI or an AWS SDK](ExamplePolicies_EC2.md)\. **Note**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/control-access-with-tags.md
da4de42ea446-1
**Note** If you allow or deny users access to resources based on tags, you must consider explicitly denying users the ability to add those tags to or remove them from the same resources\. Otherwise, it's possible for a user to circumvent your restrictions and gain access to a resource by modifying its tags\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/control-access-with-tags.md
1cfd4d7bf60c-0
To use a Spot Fleet, you create a Spot Fleet request that includes the target capacity, an optional On\-Demand portion, one or more launch specifications for the instances, and the maximum price that you are willing to pay\. Amazon EC2 attempts to maintain your Spot Fleet's target capacity as Spot prices change\. For more information, see [How Spot Fleet works](spot-fleet.md)\. There are two types of Spot Fleet requests: `request` and `maintain`\. You can create a Spot Fleet to submit a one\-time request for your desired capacity, or require it to maintain a target capacity over time\. Both types of requests benefit from Spot Fleet's allocation strategy\. When you make a one\-time request, Spot Fleet places the required requests but does not attempt to replenish Spot Instances if capacity is diminished\. If capacity is not available, Spot Fleet does not submit requests in alternative Spot pools\. To maintain a target capacity, Spot Fleet places requests to meet the target capacity and automatically replenish any interrupted instances\. It is not possible to modify the target capacity of a one\-time request after it's been submitted\. To change the target capacity, cancel the request and submit a new one\. A Spot Fleet request remains active until it expires or you cancel it\. When you cancel a Spot Fleet request, you may specify whether canceling your Spot Fleet request terminates the Spot Instances in your Spot Fleet\. Each launch specification includes the information that Amazon EC2 needs to launch an instance, such as an AMI, instance type, subnet or Availability Zone, and one or more security groups\. **Topics**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
1cfd4d7bf60c-1
**Topics** + [Spot Fleet request states](#spot-fleet-states) + [Spot Fleet health checks](#spot-fleet-health-checks) + [Planning a Spot Fleet request](#plan-spot-fleet) + [Spot Fleet permissions](#spot-fleet-prerequisites) + [Creating a Spot Fleet request](#create-spot-fleet) + [Tagging a Spot Fleet](#tag-spot-fleet) + [Monitoring your Spot Fleet](#manage-spot-fleet) + [Modifying a Spot Fleet request](#modify-spot-fleet) + [Canceling a Spot Fleet request](#cancel-spot-fleet) + [Spot Fleet example configurations](spot-fleet-examples.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
75520da2d629-0
A Spot Fleet request can be in one of the following states: + `submitted` – The Spot Fleet request is being evaluated and Amazon EC2 is preparing to launch the target number of instances\. + `active` – The Spot Fleet has been validated and Amazon EC2 is attempting to maintain the target number of running Spot Instances\. The request remains in this state until it is modified or canceled\. + `modifying` – The Spot Fleet request is being modified\. The request remains in this state until the modification is fully processed or the Spot Fleet is canceled\. A one\-time `request` cannot be modified, and this state does not apply to such Spot requests\. + `cancelled_running` – The Spot Fleet is canceled and does not launch additional Spot Instances\. Its existing Spot Instances continue to run until they are interrupted or terminated\. The request remains in this state until all instances are interrupted or terminated\. + `cancelled_terminating` – The Spot Fleet is canceled and its Spot Instances are terminating\. The request remains in this state until all instances are terminated\. + `cancelled` – The Spot Fleet is canceled and has no running Spot Instances\. The Spot Fleet request is deleted two days after its instances were terminated\. The following illustration represents the transitions between the request states\. If you exceed your Spot Fleet limits, the request is canceled immediately\. ![\[Spot Fleet request states\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/Spot_fleet_states.png)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
d2d70026fdb7-0
Spot Fleet checks the health status of the Spot Instances in the fleet every two minutes\. The health status of an instance is either `healthy` or `unhealthy`\. Spot Fleet determines the health status of an instance using the status checks provided by Amazon EC2\. If the status of either the instance status check or the system status check is `impaired` for three consecutive health checks, the health status of the instance is `unhealthy`\. Otherwise, the health status is `healthy`\. For more information, see [Status checks for your instances](monitoring-system-instance-status-check.md)\. You can configure your Spot Fleet to replace unhealthy instances\. After enabling health check replacement, an instance is replaced after its health status is reported as `unhealthy`\. The Spot Fleet could go below its target capacity for up to a few minutes while an unhealthy instance is being replaced\. **Requirements** + Health check replacement is supported only with Spot Fleets that maintain a target capacity, not with one\-time Spot Fleets\. + You can configure your Spot Fleet to replace unhealthy instances only when you create it\. + IAM users can use health check replacement only if they have permission to call the `ec2:DescribeInstanceStatus` action\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
40f40841eb48-0
Before you create a Spot Fleet request, review [Spot Best Practices](https://aws.amazon.com/ec2/spot/getting-started/#bestpractices)\. Use these best practices when you plan your Spot Fleet request so that you can provision the type of instances you want at the lowest possible price\. We also recommend that you do the following: + Determine whether you want to create a Spot Fleet that submits a one\-time request for the desired target capacity, or one that maintains a target capacity over time\. + Determine the instance types that meet your application requirements\. + Determine the target capacity for your Spot Fleet request\. You can set the target capacity in instances or in custom units\. For more information, see [Spot Fleet instance weighting](spot-fleet.md#spot-instance-weighting)\. + Determine what portion of the Spot Fleet target capacity must be On\-Demand capacity\. You can specify 0 for On\-Demand capacity\. + Determine your price per unit, if you are using instance weighting\. To calculate the price per unit, divide the price per instance hour by the number of units \(or weight\) that this instance represents\. If you are not using instance weighting, the default price per unit is the price per instance hour\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
40f40841eb48-1
+ Review the possible options for your Spot Fleet request\. For more information, see the [request\-spot\-fleet](https://docs.aws.amazon.com/cli/latest/reference/ec2/request-spot-fleet.html) command in the *AWS CLI Command Reference*\. For additional examples, see [Spot Fleet example configurations](spot-fleet-examples.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
6d1908473681-0
If your IAM users will create or manage a Spot Fleet, you need to grant them the required permissions\. If you use the Amazon EC2 console to create a Spot Fleet, it creates a service\-linked role named `AWSServiceRoleForEC2SpotFleet` and a role named `aws-ec2-spot-fleet-tagging-role` that grant the Spot Fleet the permissions to request, launch, terminate, and tag resources on your behalf\. If you use the AWS CLI or an API, you must ensure that these roles exist\. Use the following instructions to grant the required permissions and create the roles\. **Topics** + [Granting permission to IAM users for Spot Fleet](#spot-fleet-iam-users) + [Service\-linked role for Spot Fleet](#service-linked-roles-spot-fleet-requests) + [IAM role for Spot Fleet](#spot-fleet-service-linked-role)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
16619b502405-0
If your IAM users will create or manage a Spot Fleet, be sure to grant them the required permissions as follows\. **To grant an IAM user permissions for Spot Fleet** 1. Open the IAM console at [https://console\.aws\.amazon\.com/iam/](https://console.aws.amazon.com/iam/)\. 1. In the navigation pane, choose **Policies**, **Create policy**\. 1. On the **Create policy** page, choose **JSON**, and replace the text with the following\. ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:RunInstances", "ec2:CreateTags", "ec2:RequestSpotFleet", "ec2:ModifySpotFleetRequest", "ec2:CancelSpotFleetRequests", "ec2:DescribeSpotFleetRequests", "ec2:DescribeSpotFleetInstances", "ec2:DescribeSpotFleetRequestHistory" ], "Resource": "*" }, { "Effect": "Allow",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
16619b502405-1
], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::*:role/aws-ec2-spot-fleet-tagging-role" }, { "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole", "iam:ListRoles", "iam:ListInstanceProfiles" ], "Resource": "*" } ] } ``` The preceding example policy grants an IAM user the permissions required for most Spot Fleet use cases\. To limit the user to specific API actions, specify only those API actions instead\. **Required EC2 and IAM APIs** The following APIs must be included in the policy: + `ec2:RunInstances` – Required to launch instances in a Spot Fleet + `ec2:CreateTags` – Required to tag the Spot Fleet request, instances, or volumes + `iam:PassRole` – Required to specify the Spot Fleet role + `iam:CreateServiceLinkedRole` – Required to create the service\-linked role
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
16619b502405-2
+ `iam:CreateServiceLinkedRole` – Required to create the service\-linked role + `iam:ListRoles` – Required to enumerate existing IAM roles + `iam:ListInstanceProfiles` – Required to enumerate existing instance profiles **Important** If you specify a role for the IAM instance profile in the launch specification or launch template, you must grant the IAM user the permission to pass the role to the service\. To do this, in the IAM policy include `"arn:aws:iam::*:role/IamInstanceProfile-role"` as a resource for the `iam:PassRole` action\. For more information, see [Granting a User Permissions to Pass a Role to an AWS Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) in the *IAM User Guide*\. **Spot Fleet APIs** Add the following Spot Fleet API actions to your policy, as needed: + `ec2:RequestSpotFleet` + `ec2:ModifySpotFleetRequest` + `ec2:CancelSpotFleetRequests` + `ec2:DescribeSpotFleetRequests` + `ec2:DescribeSpotFleetInstances` + `ec2:DescribeSpotFleetRequestHistory` **Optional IAM APIs**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
16619b502405-3
+ `ec2:DescribeSpotFleetRequestHistory` **Optional IAM APIs** \(Optional\) To enable an IAM user to create roles or instance profiles using the IAM console, you must add the following actions to the policy: + `iam:AddRoleToInstanceProfile` + `iam:AttachRolePolicy` + `iam:CreateInstanceProfile` + `iam:CreateRole` + `iam:GetRole` + `iam:ListPolicies` 1. Choose **Review policy**\. 1. On the **Review policy** page, enter a policy name and description, and choose **Create policy**\. 1. In the navigation pane, choose **Users** and select the user\. 1. Choose **Permissions**, **Add permissions**\. 1. Choose **Attach existing policies directly**\. Select the policy that you created earlier and choose **Next: Review**\. 1. Choose **Add permissions**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
42fc7e1f9686-0
Amazon EC2 uses service\-linked roles for the permissions that it requires to call other AWS services on your behalf\. A service\-linked role is a unique type of IAM role that is linked directly to an AWS service\. Service\-linked roles provide a secure way to delegate permissions to AWS services because only the linked service can assume a service\-linked role\. For more information, see [Using Service\-Linked Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) in the *IAM User Guide*\. Amazon EC2 uses the service\-linked role named **AWSServiceRoleForEC2SpotFleet** to launch and manage instances on your behalf\. **Important** If you specify an [encrypted AMI](AMIEncryption.md) or an [encrypted Amazon EBS snapshot](EBSEncryption.md) in your Spot Fleet, you must grant the **AWSServiceRoleForEC2SpotFleet** role permission to use the CMK so that Amazon EC2 can launch instances on your behalf\. For more information, see [Granting access to CMKs for use with encrypted AMIs and EBS snapshots](#spot-fleet-service-linked-roles-access-to-cmks)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
d7b3bc3d8bdf-0
Amazon EC2 uses **AWSServiceRoleForEC2SpotFleet** to complete the following actions: + `ec2:RequestSpotInstances` \- Request Spot Instances + `ec2:RunInstances` \- Launch instances + `ec2:TerminateInstances` \- Terminate instances + `ec2:DescribeImages` \- Describe Amazon Machine Images \(AMIs\) for the instances + `ec2:DescribeInstanceStatus` \- Describe the status of the instances + `ec2:DescribeSubnets` \- Describe the subnets for the instances + `ec2:CreateTags` \- Add tags to the Spot Fleet request, instances, and volumes + `elasticloadbalancing:RegisterInstancesWithLoadBalancer` \- Add the specified instances to the specified load balancer + `elasticloadbalancing:RegisterTargets` \- Register the specified targets with the specified target group
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
bdb15d9596f7-0
Under most circumstances, you don't need to manually create a service\-linked role\. Amazon EC2 creates the **AWSServiceRoleForEC2SpotFleet** service\-linked role the first time you create a Spot Fleet using the console\. If you use the AWS CLI or an API, you must ensure that this role exists\. If you had an active Spot Fleet request before October 2017, when Amazon EC2 began supporting this service\-linked role, Amazon EC2 created the **AWSServiceRoleForEC2SpotFleet** role in your AWS account\. For more information, see [A New Role Appeared in My AWS Account](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_roles.html#troubleshoot_roles_new-role-appeared) in the *IAM User Guide*\. Ensure that this role exists before you use the AWS CLI or an API to create a Spot Fleet\. To create the role, use the IAM console as follows\. **To manually create the AWSServiceRoleForEC2SpotFleet service\-linked role** 1. Open the IAM console at [https://console\.aws\.amazon\.com/iam/](https://console.aws.amazon.com/iam/)\. 1. In the navigation pane, choose **Roles**\. 1. Choose **Create role**\. 1. For **Select type of trusted entity**, choose **AWS service**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
bdb15d9596f7-1
1. Choose **Create role**\. 1. For **Select type of trusted entity**, choose **AWS service**\. 1. In the list of services, choose **EC2**\. 1. In the **Select your use case** section, choose **EC2 \- Spot Fleet** 1. Choose **Next: Permissions**\. 1. On the next page, choose **Next:Review**\. 1. On the **Review** page, choose **Create role**\. If you no longer need to use Spot Fleet, we recommend that you delete the **AWSServiceRoleForEC2SpotFleet** role\. After this role is deleted from your account, Amazon EC2 will create the role again if you request a Spot Fleet using the console\. For more information, see [Deleting a Service\-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
01ff9f325649-0
If you specify an [encrypted AMI](AMIEncryption.md) or an [encrypted Amazon EBS snapshot](EBSEncryption.md) in your Spot Fleet request and you use a customer managed customer master key \(CMK\) for encryption, you must grant the **AWSServiceRoleForEC2SpotFleet** role permission to use the CMK so that Amazon EC2 can launch instances on your behalf\. To do this, you must add a grant to the CMK, as shown in the following procedure\. When providing permissions, grants are an alternative to key policies\. For more information, see [Using Grants](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) and [Using Key Policies in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the *AWS Key Management Service Developer Guide*\. **To grant the AWSServiceRoleForEC2SpotFleet role permissions to use the CMK**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
01ff9f325649-1
**To grant the AWSServiceRoleForEC2SpotFleet role permissions to use the CMK** + Use the [create\-grant](https://docs.aws.amazon.com/cli/latest/reference/kms/create-grant.html) command to add a grant to the CMK and to specify the principal \(the **AWSServiceRoleForEC2SpotFleet** service\-linked role\) that is given permission to perform the operations that the grant permits\. The CMK is specified by the `key-id` parameter and the ARN of the CMK\. The principal is specified by the `grantee-principal` parameter and the ARN of the **AWSServiceRoleForEC2SpotFleet** service\-linked role\. ``` aws kms create-grant \ --region us-east-1 \ --key-id arn:aws:kms:us-east-1:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab \ --grantee-principal arn:aws:iam::111122223333:role/AWSServiceRoleForEC2SpotFleet \ --operations "Decrypt" "Encrypt" "GenerateDataKey" "GenerateDataKeyWithoutPlaintext" "CreateGrant" "DescribeKey" "ReEncryptFrom" "ReEncryptTo" ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md
3644aba8323b-0
The `aws-ec2-spot-fleet-tagging-role` IAM role grants the Spot Fleet permission to tag the Spot Fleet request, instances, and volumes\. For more information, see [Tagging a Spot Fleet](#tag-spot-fleet)\. **Important** If you choose to tag instances in the fleet and you choose to maintain target capacity \(the Spot Fleet request is of type `maintain`\), the differences in permissions of the IAM user and the `IamFleetRole` might lead to inconsistent tagging behavior of instances in the fleet\. If the `IamFleetRole` does not include the `CreateTags` permission, some of the instances launched by the fleet might not be tagged\. While we are working to fix this inconsistency, to ensure that all instances launched by the fleet are tagged, we recommend that you use the `aws-ec2-spot-fleet-tagging-role` role for the `IamFleetRole`\. Alternatively, to use an existing role, attach the `AmazonEC2SpotFleetTaggingRole` AWS Managed Policy to the existing role\. Otherwise, you need to manually add the `CreateTags` permission to your existing policy\. **To create the IAM role for tagging a Spot Fleet** 1. Open the IAM console at [https://console\.aws\.amazon\.com/iam/](https://console.aws.amazon.com/iam/)\. 1. In the navigation pane, choose **Roles**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/spot-fleet-requests.md