id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
31e6c06500d8-2 | The following instance types provide the ability for an operating system to control processor C\-states:
+ General purpose: `m5.12xlarge` \| `m5.24xlarge` \| `m5d.12xlarge` \| `m5d.24xlarge` \| `m5n.12xlarge` \| `m5n.24xlarge` \| `m5dn.12xlarge` \| `m5dn.24xlarge`
+ Compute optimized: `c5.9xlarge` \| `c5.12xlarge` \| `c5.18xlarge` \| `c5.24xlarge` \| `c5a.24xlarge` \| `c5ad.24xlarge` \| `c5d.9xlarge` \| `c5d.12xlarge` \| `c5d.18xlarge` \| `c5d.24xlarge` \| `c5n.9xlarge` \| `c5n.18xlarge`
+ Memory optimized: `r5.12xlarge` \| `r5.24xlarge` \| `r5d.12xlarge` \| `r5d.24xlarge` \| `r5n.12xlarge` \| `r5n.24xlarge` \| `r5dn.12xlarge` \| `r5dn.24xlarge` \| `z1d.6xlarge` \| `z1d.12xlarge` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
31e6c06500d8-3 | + Storage optimized: `i3en.12xlarge` \| `i3en.24xlarge`
+ Accelerated computing: `inf1.24xlarge` \| `p3dn.24xlarge`
AWS Graviton processors have built\-in power saving modes and operate at a fixed frequency\. Therefore, they do not provide the ability for the operating system to control C\-states and P\-states\.
You might want to change the C\-state or P\-state settings to increase processor performance consistency, reduce latency, or tune your instance for a specific workload\. The default C\-state and P\-state settings provide maximum performance, which is optimal for most workloads\. However, if your application would benefit from reduced latency at the cost of higher single\- or dual\-core frequencies, or from consistent performance at lower frequencies as opposed to bursty Turbo Boost frequencies, consider experimenting with the C\-state or P\-state settings that are available to these instances\.
The following sections describe the different processor state configurations and how to monitor the effects of your configuration\. These procedures were written for, and apply to Amazon Linux; however, they may also work for other Linux distributions with a Linux kernel version of 3\.9 or newer\. For more information about other Linux distributions and processor state control, see your system\-specific documentation\.
**Note**
The examples on this page use the turbostat utility \(which is available on Amazon Linux by default\) to display processor frequency and C\-state information, and the stress command \(which can be installed by running sudo yum install \-y stress\) to simulate a workload\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
31e6c06500d8-4 | If the output does not display the C\-state information, include the \-\-debug option in the command \(sudo turbostat \-\-debug stress *<options>*\)\.
**Topics**
+ [Highest performance with maximum Turbo Boost frequency](#turbo-perf)
+ [High performance and low latency by limiting deeper C\-states](#c-states)
+ [Baseline performance with the lowest variability](#baseline-perf) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
57eb169b27d3-0 | This is the default processor state control configuration for the Amazon Linux AMI, and it is recommended for most workloads\. This configuration provides the highest performance with lower variability\. Allowing inactive cores to enter deeper sleep states provides the thermal headroom required for single or dual core processes to reach their maximum Turbo Boost potential\.
The following example shows a `c4.8xlarge` instance with two cores actively performing work reaching their maximum processor Turbo Boost frequency\.
```
[ec2-user ~]$ sudo turbostat stress -c 2 -t 10
stress: info: [30680] dispatching hogs: 2 cpu, 0 io, 0 vm, 0 hdd
stress: info: [30680] successful run completed in 10s
pk cor CPU %c0 GHz TSC SMI %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6 %pc7 Pkg_W RAM_W PKG_% RAM_%
5.54 3.44 2.90 0 9.18 0.00 85.28 0.00 0.00 0.00 0.00 0.00 94.04 32.70 54.18 0.00
0 0 0 0.12 3.26 2.90 0 3.61 0.00 96.27 0.00 0.00 0.00 0.00 0.00 48.12 18.88 26.02 0.00
0 0 18 0.12 3.26 2.90 0 3.61
0 1 1 0.12 3.26 2.90 0 4.11 0.00 95.77 0.00 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
57eb169b27d3-1 | 0 1 1 0.12 3.26 2.90 0 4.11 0.00 95.77 0.00
0 1 19 0.13 3.27 2.90 0 4.11
0 2 2 0.13 3.28 2.90 0 4.45 0.00 95.42 0.00
0 2 20 0.11 3.27 2.90 0 4.47
0 3 3 0.05 3.42 2.90 0 99.91 0.00 0.05 0.00
0 3 21 97.84 3.45 2.90 0 2.11
...
1 1 10 0.06 3.33 2.90 0 99.88 0.01 0.06 0.00
1 1 28 97.61 3.44 2.90 0 2.32
...
10.002556 sec
```
In this example, vCPUs 21 and 28 are running at their maximum Turbo Boost frequency because the other cores have entered the `C6` sleep state to save power and provide both power and thermal headroom for the working cores\. vCPUs 3 and 10 \(each sharing a processor core with vCPUs 21 and 28\) are in the `C1` state, waiting for instruction\.
In the following example, all 18 cores are actively performing work, so there is no headroom for maximum Turbo Boost, but they are all running at the "all core Turbo Boost" speed of 3\.2 GHz\.
```
[ec2-user ~]$ sudo turbostat stress -c 36 -t 10 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
57eb169b27d3-2 | ```
[ec2-user ~]$ sudo turbostat stress -c 36 -t 10
stress: info: [30685] dispatching hogs: 36 cpu, 0 io, 0 vm, 0 hdd
stress: info: [30685] successful run completed in 10s
pk cor CPU %c0 GHz TSC SMI %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6 %pc7 Pkg_W RAM_W PKG_% RAM_%
99.27 3.20 2.90 0 0.26 0.00 0.47 0.00 0.00 0.00 0.00 0.00 228.59 31.33 199.26 0.00
0 0 0 99.08 3.20 2.90 0 0.27 0.01 0.64 0.00 0.00 0.00 0.00 0.00 114.69 18.55 99.32 0.00
0 0 18 98.74 3.20 2.90 0 0.62
0 1 1 99.14 3.20 2.90 0 0.09 0.00 0.76 0.00
0 1 19 98.75 3.20 2.90 0 0.49
0 2 2 99.07 3.20 2.90 0 0.10 0.02 0.81 0.00
0 2 20 98.73 3.20 2.90 0 0.44
0 3 3 99.02 3.20 2.90 0 0.24 0.00 0.74 0.00 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
57eb169b27d3-3 | 0 3 3 99.02 3.20 2.90 0 0.24 0.00 0.74 0.00
0 3 21 99.13 3.20 2.90 0 0.13
0 4 4 99.26 3.20 2.90 0 0.09 0.00 0.65 0.00
0 4 22 98.68 3.20 2.90 0 0.67
0 5 5 99.19 3.20 2.90 0 0.08 0.00 0.73 0.00
0 5 23 98.58 3.20 2.90 0 0.69
0 6 6 99.01 3.20 2.90 0 0.11 0.00 0.89 0.00
0 6 24 98.72 3.20 2.90 0 0.39
...
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
210d1142862f-0 | C\-states control the sleep levels that a core may enter when it is inactive\. You may want to control C\-states to tune your system for latency versus performance\. Putting cores to sleep takes time, and although a sleeping core allows more headroom for another core to boost to a higher frequency, it takes time for that sleeping core to wake back up and perform work\. For example, if a core that is assigned to handle network packet interrupts is asleep, there may be a delay in servicing that interrupt\. You can configure the system to not use deeper C\-states, which reduces the processor reaction latency, but that in turn also reduces the headroom available to other cores for Turbo Boost\.
A common scenario for disabling deeper sleep states is a Redis database application, which stores the database in system memory for the fastest possible query response time\.
**To limit deeper sleep states on Amazon Linux 2**
1. Open the `/etc/default/grub` file with your editor of choice\.
```
[ec2-user ~]$ sudo vim /etc/default/grub
```
1. Edit the `GRUB_CMDLINE_LINUX_DEFAULT` line and add the `intel_idle.max_cstate=1` option to set `C1` as the deepest C\-state for idle cores\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
210d1142862f-1 | ```
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 intel_idle.max_cstate=1"
GRUB_TIMEOUT=0
```
1. Save the file and exit your editor\.
1. Run the following command to rebuild the boot configuration\.
```
[ec2-user ~]$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
```
1. Reboot your instance to enable the new kernel option\.
```
[ec2-user ~]$ sudo reboot
```
**To limit deeper sleep states on Amazon Linux AMI**
1. Open the `/boot/grub/grub.conf` file with your editor of choice\.
```
[ec2-user ~]$ sudo vim /boot/grub/grub.conf
```
1. Edit the `kernel` line of the first entry and add the `intel_idle.max_cstate=1` option to set `C1` as the deepest C\-state for idle cores\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
d2d031a67b43-0 | default=0
timeout=1
hiddenmenu
title Amazon Linux 2014.09 (3.14.26-24.46.amzn1.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-3.14.26-24.46.amzn1.x86_64 root=LABEL=/ console=ttyS0 intel_idle.max_cstate=1
initrd /boot/initramfs-3.14.26-24.46.amzn1.x86_64.img
```
1. Save the file and exit your editor\.
1. Reboot your instance to enable the new kernel option\.
```
[ec2-user ~]$ sudo reboot
```
The following example shows a `c4.8xlarge` instance with two cores actively performing work at the "all core Turbo Boost" core frequency\.
```
[ec2-user ~]$ sudo turbostat stress -c 2 -t 10
stress: info: [5322] dispatching hogs: 2 cpu, 0 io, 0 vm, 0 hdd
stress: info: [5322] successful run completed in 10s
pk cor CPU %c0 GHz TSC SMI %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6 %pc7 Pkg_W RAM_W PKG_% RAM_% | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
d2d031a67b43-1 | 5.56 3.20 2.90 0 94.44 0.00 0.00 0.00 0.00 0.00 0.00 0.00 131.90 31.11 199.47 0.00
0 0 0 0.03 2.08 2.90 0 99.97 0.00 0.00 0.00 0.00 0.00 0.00 0.00 67.23 17.11 99.76 0.00
0 0 18 0.01 1.93 2.90 0 99.99
0 1 1 0.02 1.96 2.90 0 99.98 0.00 0.00 0.00
0 1 19 99.70 3.20 2.90 0 0.30
...
1 1 10 0.02 1.97 2.90 0 99.98 0.00 0.00 0.00
1 1 28 99.67 3.20 2.90 0 0.33
1 2 11 0.04 2.63 2.90 0 99.96 0.00 0.00 0.00
1 2 29 0.02 2.11 2.90 0 99.98
...
```
In this example, the cores for vCPUs 19 and 28 are running at 3\.2 GHz, and the other cores are in the `C1` C\-state, awaiting instruction\. Although the working cores are not reaching their maximum Turbo Boost frequency, the inactive cores will be much faster to respond to new requests than they would be in the deeper `C6` C\-state\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
5fd5b2e1f1e2-0 | You can reduce the variability of processor frequency with P\-states\. P\-states control the desired performance \(in CPU frequency\) from a core\. Most workloads perform better in P0, which requests Turbo Boost\. But you may want to tune your system for consistent performance rather than bursty performance that can happen when Turbo Boost frequencies are enabled\.
Intel Advanced Vector Extensions \(AVX or AVX2\) workloads can perform well at lower frequencies, and AVX instructions can use more power\. Running the processor at a lower frequency, by disabling Turbo Boost, can reduce the amount of power used and keep the speed more consistent\. For more information about optimizing your instance configuration and workload for AVX, see [http://www\.intel\.com/content/dam/www/public/us/en/documents/white\-papers/performance\-xeon\-e5\-v3\-advanced\-vector\-extensions\-paper\.pdf](http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/performance-xeon-e5-v3-advanced-vector-extensions-paper.pdf)\.
This section describes how to limit deeper sleep states and disable Turbo Boost \(by requesting the `P1` P\-state\) to provide low\-latency and the lowest processor speed variability for these types of workloads\.
**To limit deeper sleep states and disable Turbo Boost on Amazon Linux 2**
1. Open the `/etc/default/grub` file with your editor of choice\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
5fd5b2e1f1e2-1 | 1. Open the `/etc/default/grub` file with your editor of choice\.
```
[ec2-user ~]$ sudo vim /etc/default/grub
```
1. Edit the `GRUB_CMDLINE_LINUX_DEFAULT` line and add the `intel_idle.max_cstate=1` option to set `C1` as the deepest C\-state for idle cores\.
```
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 intel_idle.max_cstate=1"
GRUB_TIMEOUT=0
```
1. Save the file and exit your editor\.
1. Run the following command to rebuild the boot configuration\.
```
[ec2-user ~]$ grub2-mkconfig -o /boot/grub2/grub.cfg
```
1. Reboot your instance to enable the new kernel option\.
```
[ec2-user ~]$ sudo reboot
```
1. When you need the low processor speed variability that the `P1` P\-state provides, execute the following command to disable Turbo Boost\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
5fd5b2e1f1e2-2 | ```
[ec2-user ~]$ sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"
```
1. When your workload is finished, you can re\-enable Turbo Boost with the following command\.
```
[ec2-user ~]$ sudo sh -c "echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo"
```
**To limit deeper sleep states and disable Turbo Boost on Amazon Linux AMI**
1. Open the `/boot/grub/grub.conf` file with your editor of choice\.
```
[ec2-user ~]$ sudo vim /boot/grub/grub.conf
```
1. Edit the `kernel` line of the first entry and add the `intel_idle.max_cstate=1` option to set `C1` as the deepest C\-state for idle cores\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
274faefa0f0f-0 | default=0
timeout=1
hiddenmenu
title Amazon Linux 2014.09 (3.14.26-24.46.amzn1.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-3.14.26-24.46.amzn1.x86_64 root=LABEL=/ console=ttyS0 intel_idle.max_cstate=1
initrd /boot/initramfs-3.14.26-24.46.amzn1.x86_64.img
```
1. Save the file and exit your editor\.
1. Reboot your instance to enable the new kernel option\.
```
[ec2-user ~]$ sudo reboot
```
1. When you need the low processor speed variability that the `P1` P\-state provides, execute the following command to disable Turbo Boost\.
```
[ec2-user ~]$ sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo"
```
1. When your workload is finished, you can re\-enable Turbo Boost with the following command\.
```
[ec2-user ~]$ sudo sh -c "echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo"
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
274faefa0f0f-1 | ```
The following example shows a `c4.8xlarge` instance with two vCPUs actively performing work at the baseline core frequency, with no Turbo Boost\.
```
[ec2-user ~]$ sudo turbostat stress -c 2 -t 10
stress: info: [5389] dispatching hogs: 2 cpu, 0 io, 0 vm, 0 hdd
stress: info: [5389] successful run completed in 10s
pk cor CPU %c0 GHz TSC SMI %c1 %c3 %c6 %c7 %pc2 %pc3 %pc6 %pc7 Pkg_W RAM_W PKG_% RAM_%
5.59 2.90 2.90 0 94.41 0.00 0.00 0.00 0.00 0.00 0.00 0.00 128.48 33.54 200.00 0.00
0 0 0 0.04 2.90 2.90 0 99.96 0.00 0.00 0.00 0.00 0.00 0.00 0.00 65.33 19.02 100.00 0.00
0 0 18 0.04 2.90 2.90 0 99.96
0 1 1 0.05 2.90 2.90 0 99.95 0.00 0.00 0.00
0 1 19 0.04 2.90 2.90 0 99.96
0 2 2 0.04 2.90 2.90 0 99.96 0.00 0.00 0.00 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
274faefa0f0f-2 | 0 2 2 0.04 2.90 2.90 0 99.96 0.00 0.00 0.00
0 2 20 0.04 2.90 2.90 0 99.96
0 3 3 0.05 2.90 2.90 0 99.95 0.00 0.00 0.00
0 3 21 99.95 2.90 2.90 0 0.05
...
1 1 28 99.92 2.90 2.90 0 0.08
1 2 11 0.06 2.90 2.90 0 99.94 0.00 0.00 0.00
1 2 29 0.05 2.90 2.90 0 99.95
```
The cores for vCPUs 21 and 28 are actively performing work at the baseline processor speed of 2\.9 GHz, and all inactive cores are also running at the baseline speed in the `C1` C\-state, ready to accept instructions\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/processor_state_control.md |
6afd989627ab-0 | After you launch an instance, you can open the Amazon EC2 console and view the monitoring graphs for an instance on the **Monitoring** tab\. Each graph is based on one of the available Amazon EC2 metrics\.
The following graphs are available:
+ Average CPU Utilization \(Percent\)
+ Average Disk Reads \(Bytes\)
+ Average Disk Writes \(Bytes\)
+ Maximum Network In \(Bytes\)
+ Maximum Network Out \(Bytes\)
+ Summary Disk Read Operations \(Count\)
+ Summary Disk Write Operations \(Count\)
+ Summary Status \(Any\)
+ Summary Status Instance \(Count\)
+ Summary Status System \(Count\)
For more information about the metrics and the data they provide to the graphs, see [List the available CloudWatch metrics for your instances](viewing_metrics_with_cloudwatch.md)\.
**Graph Metrics Using the CloudWatch Console**
You can also use the CloudWatch console to graph metric data generated by Amazon EC2 and other AWS services\. For more information, see [Graph Metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph_metrics.html) in the *Amazon CloudWatch User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/graphs-in-the-aws-management-console.md |
8b81970248e2-0 | When working with instance user data, keep the following in mind:
+ User data must be base64\-encoded\. The Amazon EC2 console can perform the base64\-encoding for you or accept base64\-encoded input\.
+ User data is limited to 16 KB, in raw form, before it is base64\-encoded\. The size of a string of length *n* after base64\-encoding is ceil\(*n*/3\)\*4\.
+ User data must be base64\-decoded when you retrieve it\. If you retrieve the data using instance metadata or the console, it's decoded for you automatically\.
+ User data is treated as opaque data: what you give is what you get back\. It is up to the instance to be able to interpret it\.
+ If you stop an instance, modify its user data, and start the instance, the updated user data is not executed when you start the instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
2011f78ff99b-0 | You can specify user data when you launch an instance\. For more information, see [Launching an instance using the Launch Instance Wizard](launching-instance.md) and [Running commands on your Linux instance at launch](user-data.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
0f8945f275e8-0 | You can modify user data for an instance in the stopped state if the root volume is an EBS volume\. For more information, see [View and update the instance user data](user-data.md#user-data-view-change)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
5b49be0aa3b7-0 | To retrieve user data from within a running instance, use the following URI\.
```
http://169.254.169.254/latest/user-data
```
A request for user data returns the data as it is \(content type `application/octet-stream`\)\.
This example returns user data that was provided as comma\-separated text\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
694a1a450da1-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/user-data
1234,john,reboot,true | 4512,richard, | 173,,,
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
88e804e70256-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/user-data
1234,john,reboot,true | 4512,richard, | 173,,,
```
------
This example returns user data that was provided as a script\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
c35f209ccccd-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/user-data
#!/bin/bash
yum update -y
service httpd start
chkconfig httpd on
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
3254a438bf93-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/user-data
#!/bin/bash
yum update -y
service httpd start
chkconfig httpd on
```
------
To retrieve user data for an instance from your own computer, see [User data and the AWS CLI](user-data.md#user-data-api-cli) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/instancedata-add-user-data.md |
a4042ace6b4d-0 | When you launch a new EC2 instance, the EC2 service attempts to place the instance in such a way that all of your instances are spread out across underlying hardware to minimize correlated failures\. You can use *placement groups* to influence the placement of a group of *interdependent* instances to meet the needs of your workload\. Depending on the type of workload, you can create a placement group using one of the following placement strategies:
+ *Cluster* – packs instances close together inside an Availability Zone\. This strategy enables workloads to achieve the low\-latency network performance necessary for tightly\-coupled node\-to\-node communication that is typical of HPC applications\.
+ *Partition* – spreads your instances across logical partitions such that groups of instances in one partition do not share the underlying hardware with groups of instances in different partitions\. This strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra, and Kafka\.
+ *Spread* – strictly places a small group of instances across distinct underlying hardware to reduce correlated failures\.
There is no charge for creating a placement group\.
**Topics**
+ [Cluster placement groups](#placement-groups-cluster)
+ [Partition placement groups](#placement-groups-partition)
+ [Spread placement groups](#placement-groups-spread)
+ [Placement group rules and limitations](#concepts-placement-groups)
+ [Creating a placement group](#create-placement-group)
+ [Tagging a placement group](#tag-placement-group) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
a4042ace6b4d-1 | + [Creating a placement group](#create-placement-group)
+ [Tagging a placement group](#tag-placement-group)
+ [Launching instances in a placement group](#launch-instance-placement-group)
+ [Describing instances in a placement group](#describe-instance-placement)
+ [Changing the placement group for an instance](#change-instance-placement-group)
+ [Deleting a placement group](#delete-placement-group) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
f063228a14f3-0 | A cluster placement group is a logical grouping of instances within a single Availability Zone\. A cluster placement group can span peered VPCs in the same Region\. Instances in the same cluster placement group enjoy a higher per\-flow throughput limit for TCP/IP traffic and are placed in the same high\-bisection bandwidth segment of the network\.
The following image shows instances that are placed into a cluster placement group\.
![\[A cluster placement group\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/placement-group-cluster.png)
Cluster placement groups are recommended for applications that benefit from low network latency, high network throughput, or both\. They are also recommended when the majority of the network traffic is between the instances in the group\. To provide the lowest latency and the highest packet\-per\-second network performance for your placement group, choose an instance type that supports enhanced networking\. For more information, see [Enhanced Networking](enhanced-networking.md)\.
We recommend that you launch your instances in the following way:
+ Use a single launch request to launch the number of instances that you need in the placement group\.
+ Use the same instance type for all instances in the placement group\.
If you try to add more instances to the placement group later, or if you try to launch more than one instance type in the placement group, you increase your chances of getting an insufficient capacity error\.
If you stop an instance in a placement group and then start it again, it still runs in the placement group\. However, the start fails if there isn't enough capacity for the instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
f063228a14f3-1 | If you receive a capacity error when launching an instance in a placement group that already has running instances, stop and start all of the instances in the placement group, and try the launch again\. Starting the instances may migrate them to hardware that has capacity for all of the requested instances\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
7abab05a09f9-0 | Partition placement groups help reduce the likelihood of correlated hardware failures for your application\. When using partition placement groups, Amazon EC2 divides each group into logical segments called partitions\. Amazon EC2 ensures that each partition within a placement group has its own set of racks\. Each rack has its own network and power source\. No two partitions within a placement group share the same racks, allowing you to isolate the impact of hardware failure within your application\.
The following image is a simple visual representation of a partition placement group in a single Availability Zone\. It shows instances that are placed into a partition placement group with three partitions—**Partition 1**, **Partition 2**, and **Partition 3**\. Each partition comprises multiple instances\. The instances in a partition do not share racks with the instances in the other partitions, allowing you to contain the impact of a single hardware failure to only the associated partition\.
![\[A partition placement group with three partitions\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/placement-group-partition.png)
Partition placement groups can be used to deploy large distributed and replicated workloads, such as HDFS, HBase, and Cassandra, across distinct racks\. When you launch instances into a partition placement group, Amazon EC2 tries to distribute the instances evenly across the number of partitions that you specify\. You can also launch instances into a specific partition to have more control over where the instances are placed\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
7abab05a09f9-1 | A partition placement group can have partitions in multiple Availability Zones in the same Region\. A partition placement group can have a maximum of seven partitions per Availability Zone\. The number of instances that can be launched into a partition placement group is limited only by the limits of your account\.
In addition, partition placement groups offer visibility into the partitions — you can see which instances are in which partitions\. You can share this information with topology\-aware applications, such as HDFS, HBase, and Cassandra\. These applications use this information to make intelligent data replication decisions for increasing data availability and durability\.
If you start or launch an instance in a partition placement group and there is insufficient unique hardware to fulfill the request, the request fails\. Amazon EC2 makes more distinct hardware available over time, so you can try your request again later\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
710552ec545e-0 | A spread placement group is a group of instances that are each placed on distinct racks, with each rack having its own network and power source\.
The following image shows seven instances in a single Availability Zone that are placed into a spread placement group\. The seven instances are placed on seven different racks\.
![\[A spread placement group\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/placement-group-spread.png)
Spread placement groups are recommended for applications that have a small number of critical instances that should be kept separate from each other\. Launching instances in a spread placement group reduces the risk of simultaneous failures that might occur when instances share the same racks\. Spread placement groups provide access to distinct racks, and are therefore suitable for mixing instance types or launching instances over time\.
A spread placement group can span multiple Availability Zones in the same Region\. You can have a maximum of seven running instances per Availability Zone per group\.
If you start or launch an instance in a spread placement group and there is insufficient unique hardware to fulfill the request, the request fails\. Amazon EC2 makes more distinct hardware available over time, so you can try your request again later\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
cfabff69e27a-0 | Before you use placement groups, be aware of the following rules:
+ The name that you specify for a placement group must be unique within your AWS account for the Region\.
+ You can't merge placement groups\.
+ An instance can be launched in one placement group at a time; it cannot span multiple placement groups\.
+ [On\-Demand Capacity Reservation](ec2-capacity-reservations.md#capacity-reservations-limits) and [zonal Reserved Instances](reserved-instances-scope.md) provide a capacity reservation for EC2 instances in a specific Availability Zone\. The capacity reservation can be used by instances in a placement group\. However, it is not possible to explicitly reserve capacity for a placement group\.
+ You cannot launch Dedicated Hosts in placement groups\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
9ae059bbb43e-0 | The following rules apply to cluster placement groups:
+ Instances in a cluster placement group you must use the following supported instance types:
+ A [current generation](instance-types.md#current-gen-instances) instance type, except for the [burstable performance](burstable-performance-instances.md) instances \(for example, T2\)\.
+ The following [previous generation](instance-types.md#previous-gen-instances) instances: C3, `cc2.8xlarge`, `cr1.8xlarge`, G2, `hs1.8xlarge`, I2, and R3\.
+ A cluster placement group can't span multiple Availability Zones\.
+ The maximum network throughput speed of traffic between two instances in a cluster placement group is limited by the slower of the two instances\. For applications with high\-throughput requirements, choose an instance type with network connectivity that meets your requirements\.
+ For instances that are enabled for enhanced networking, the following rules apply:
+ Instances within a cluster placement group can use up to 10 Gbps for single\-flow traffic\. Instances that are not within a cluster placement group can use up to 5 Gbps for single\-flow traffic\.
+ Traffic to and from Amazon S3 buckets within the same Region over the public IP address space or through a VPC endpoint can use all available instance aggregate bandwidth\.
+ You can launch multiple instance types into a cluster placement group\. However, this reduces the likelihood that the required capacity will be available for your launch to succeed\. We recommend using the same instance type for all instances in a cluster placement group\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
9ae059bbb43e-1 | + Network traffic to the internet and over an AWS Direct Connect connection to on\-premises resources is limited to 5 Gbps\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
56d9745540c0-0 | The following rules apply to partition placement groups:
+ A partition placement group supports a maximum of seven partitions per Availability Zone\. The number of instances that you can launch in a partition placement group is limited only by your account limits\.
+ When instances are launched into a partition placement group, Amazon EC2 tries to evenly distribute the instances across all partitions\. Amazon EC2 doesn’t guarantee an even distribution of instances across all partitions\.
+ A partition placement group with Dedicated Instances can have a maximum of two partitions\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
1ef8e7998e2d-0 | The following rules apply to spread placement groups:
+ A spread placement group supports a maximum of seven running instances per Availability Zone\. For example, in a Region with three Availability Zones, you can run a total of 21 instances in the group \(seven per zone\)\. If you try to start an eighth instance in the same Availability Zone and in the same spread placement group, the instance will not launch\. If you need to have more than seven instances in an Availability Zone, then the recommendation is to use multiple spread placement groups\. Using multiple spread placement groups does not provide guarantees about the spread of instances between groups, but it does ensure the spread for each group, thus limiting impact from certain classes of failures\.
+ Spread placement groups are not supported for Dedicated Instances\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
d48a77be3eaf-0 | You can create a placement group using one of the following methods\.
**Note**
You can tag a placement group on creation using the command line tools only\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
3b9e7f0ece7c-0 | **To create a placement group 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 **Placement Groups**, **Create placement group**\.
1. Specify a name for the group\.
1. Choose the placement strategy for the group\. If you choose **Partition**, choose the number of partitions within the group\.
1. Choose **Create group**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
e4ae44cfc7ba-0 | **To create a placement group 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 **Placement Groups**, **Create Placement Group**\.
1. Specify a name for the group\.
1. Choose the placement strategy for the group\. If you choose **Partition**, specify the number of partitions within the group\.
1. Choose **Create**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
3269658cf23f-0 | **To create a placement group using the AWS CLI**
Use the [create\-placement\-group](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-placement-group.html) command\. The following example creates a placement group named `my-cluster` that uses the `cluster` placement strategy, and it applies a tag with a key of `purpose` and a value of `production`\.
```
aws ec2 create-placement-group --group-name my-cluster --strategy cluster --tag-specifications 'ResourceType=placement-group,Tags={Key=purpose,Value=production}'
```
**To create a partition placement group using the AWS CLI**
Use the [create\-placement\-group](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-placement-group.html) command\. Specify the `--strategy` parameter with the value `partition`, and specify the `--partition-count` parameter with the desired number of partitions\. In this example, the partition placement group is named `HDFS-Group-A` and is created with five partitions\.
```
aws ec2 create-placement-group --group-name HDFS-Group-A --strategy partition --partition-count 5
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
a3aa9dff4779-0 | **To create a placement group using the AWS Tools for Windows PowerShell**
Use the [New\-EC2PlacementGroup](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2PlacementGroup.html) command\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
1df6239a9171-0 | To help categorize and manage your existing placement groups, you can tag them with custom metadata\. For more information about how tags work, see [Tagging your Amazon EC2 resources](Using_Tags.md)\.
When you tag a placement group, the instances that are launched into the placement group are not automatically tagged\. You need to explicitly tag the instances that are launched into the placement group\. For more information, see [Adding a tag when you launch an instance](Using_Tags.md#instance-details-tags)\.
You can view, add, and delete tags using the *new* console and the command line tools\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
8fe35ccf05be-0 | **To view, add, or delete a tag for an existing placement 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 **Placement Groups**\.
1. Select a placement group, and then choose **Actions**, **Manage tags**\.
1. The **Manage tags** section displays any tags that are assigned to the placement group\. Do the following to add or remove tags:
+ To add a tag, choose **Add tag**, and then enter the tag key and value\. You can add up to 50 tags per placement group\. For more information, see [Tag restrictions](Using_Tags.md#tag-restrictions)\.
+ To delete a tag, choose **Remove** next to the tag that you want to delete\.
1. Choose **Save changes**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
260eddb123bd-0 | **To view placement group tags**
Use the [describe\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-tags.html) command to view the tags for the specified resource\. In the following example, you describe the tags for all of your placement groups\.
```
aws ec2 describe-tags \
--filters Name=resource-type,Values=placement-group
```
```
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "pg-0123456789EXAMPLE",
"ResourceType": "placement-group",
"Value": "Production"
},
{
"Key": "Environment",
"ResourceId": "pg-9876543210EXAMPLE",
"ResourceType": "placement-group",
"Value": "Production"
}
]
}
```
You can also use the [describe\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-tags.html) command to view the tags for a placement group by specifying its ID\. In the following example, you describe the tags for `pg-0123456789EXAMPLE`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
260eddb123bd-1 | ```
aws ec2 describe-tags \
--filters Name=resource-id,Values=pg-0123456789EXAMPLE
```
```
{
"Tags": [
{
"Key": "Environment",
"ResourceId": "pg-0123456789EXAMPLE",
"ResourceType": "placement-group",
"Value": "Production"
}
]
}
```
You can also view the tags of a placement group by describing the placement group\.
Use the [describe\-placement\-groups](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-placement-groups.html) command to view the configuration of the specified placement group, which includes any tags that were specified for the placement group\.
```
aws ec2 describe-placement-groups \
--group-name my-cluster
```
```
{
"PlacementGroups": [
{
"GroupName": "my-cluster",
"State": "available",
"Strategy": "cluster",
"GroupId": "pg-0123456789EXAMPLE",
"Tags": [
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
260eddb123bd-2 | "GroupId": "pg-0123456789EXAMPLE",
"Tags": [
{
"Key": "Environment",
"Value": "Production"
}
]
}
]
}
```
**To tag an existing placement group using the AWS CLI**
You can use the [create\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html) command to tag existing resources\. In the following example, the existing placement group is tagged with Key=Cost\-Center and Value=CC\-123\.
```
aws ec2 create-tags \
--resources pg-0123456789EXAMPLE \
--tags Key=Cost-Center,Value=CC-123
```
**To delete a tag from a placement group using the AWS CLI**
You can use the [delete\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-tags.html) command to delete tags from existing resources\. For examples, see [Examples](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-tags.html#examples) in the *AWS CLI Command Reference*\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
8775a527bdae-0 | **To view placement group tags**
Use the [Get\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Tag.html) command\.
**To describe the tags for a specific placement group**
Use the [Get\-EC2PlacementGroup](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2PlacementGroup.html) command\.
**To tag an existing placement group**
Use the [New\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Tag.html) command\.
**To delete a tag from a placement group**
Use the [Remove\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2Tag.html) command\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
68e4ad426598-0 | You can launch an instance into a placement group if the [placement group rules and limitations are met](#concepts-placement-groups) using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
fca1b640e7a3-0 | **To launch instances into a placement group 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 **Instances**\.
1. Choose **Launch Instance**\. Complete the wizard as directed, taking care to do the following:
+ On the **Choose an Instance Type** page, select an instance type that can be launched into a placement group\.
+ On the **Configure Instance Details** page, the following fields are applicable to placement groups:
+ For **Number of instances**, enter the total number of instances that you need in this placement group, because you might not be able to add instances to the placement group later\.
+ For **Placement group**, select the **Add instance to placement group** check box\. If you do not see **Placement group** on this page, verify that you have selected an instance type that can be launched into a placement group\. Otherwise, this option is not available\.
+ For **Placement group name**, you can choose to add the instances to an existing placement group or to a new placement group that you create\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
fca1b640e7a3-1 | + For **Placement group name**, you can choose to add the instances to an existing placement group or to a new placement group that you create\.
+ For **Placement group strategy**, choose the appropriate strategy\. If you choose **partition**, for **Target partition**, choose **Auto distribution** to have Amazon EC2 do a best effort to distribute the instances evenly across all the partitions in the group\. Alternatively, specify the partition in which to launch the instances\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
bb1f36b596ae-0 | **To launch instances into a placement group using the AWS CLI**
Use the [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command and specify the placement group name using the `--placement "GroupName = my-cluster"` parameter\. In this example, the placement group is named `my-cluster`\.
```
aws ec2 run-instances --placement "GroupName = my-cluster"
```
**To launch instances into a specific partition of a partition placement group using the AWS CLI**
Use the [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command and specify the placement group name and partition using the `--placement "GroupName = HDFS-Group-A, PartitionNumber = 3"` parameter\. In this example, the placement group is named `HDFS-Group-A` and the partition number is `3`\.
```
aws ec2 run-instances --placement "GroupName = HDFS-Group-A, PartitionNumber = 3"
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
5146312ae193-0 | **To launch instances into a placement group using AWS Tools for Windows PowerShell**
Use the [New\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) command and specify the placement group name using the `-Placement_GroupName` parameter\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
7240d9da77eb-0 | You can view the placement information of your instances using one of the following methods\. You can also filter partition placement groups by the partition number using the AWS CLI\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
e2b1939755f4-0 | **To view the placement group and partition number of an instance 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 **Instances**\.
1. Select the instance and, in the details pane, inspect **Placement group**\. If the instance is not in a placement group, the field is empty\. Otherwise, the placement group name is displayed\. If the placement group is a partition placement group, inspect **Partition number** for the partition number for the instance\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
6e33e0ee9758-0 | **To view the partition number for an instance in a partition placement group using the AWS CLI**
Use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command and specify the `--instance-id` parameter\.
```
aws ec2 describe-instances --instance-id i-0123a456700123456
```
The response contains the placement information, which includes the placement group name and the partition number for the instance\.
```
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 3,
"Tenancy": "default"
}
```
**To filter instances for a specific partition placement group and partition number using the AWS CLI**
Use the [describe\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) command and specify the `--filters` parameter with the `placement-group-name` and `placement-partition-number` filters\. In this example, the placement group is named `HDFS-Group-A` and the partition number is `7`\.
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
6e33e0ee9758-1 | ```
aws ec2 describe-instances --filters "Name = placement-group-name, Values = HDFS-Group-A" "Name = placement-partition-number, Values = 7"
```
The response lists all the instances that are in the specified partition within the specified placement group\. The following is example output showing only the instance ID, instance type, and placement information for the returned instances\.
```
"Instances": [
{
"InstanceId": "i-0a1bc23d4567e8f90",
"InstanceType": "r4.large",
},
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 7,
"Tenancy": "default"
}
{
"InstanceId": "i-0a9b876cd5d4ef321",
"InstanceType": "r4.large",
},
"Placement": {
"AvailabilityZone": "us-east-1c",
"GroupName": "HDFS-Group-A",
"PartitionNumber": 7,
"Tenancy": "default"
}
],
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
34745f48820b-0 | You can change the placement group for an instance in any of the following ways:
+ Move an existing instance to a placement group
+ Move an instance from one placement group to another
+ Remove an instance from a placement group
Before you move or remove the instance, the instance must be in the `stopped` state\. You can move or remove an instance using the AWS CLI or an AWS SDK\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
a2fc97db0a79-0 | **To move an instance to a placement group using the AWS CLI**
1. Stop the instance using the [stop\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/stop-instances.html) command\.
1. Use the [modify\-instance\-placement](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-placement.html) command and specify the name of the placement group to which to move the instance\.
```
aws ec2 modify-instance-placement --instance-id i-0123a456700123456 --group-name MySpreadGroup
```
1. Start the instance using the [start\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/start-instances.html) command\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
e65c63f2d447-0 | **To move an instance to a placement group using the AWS Tools for Windows PowerShell**
1. Stop the instance using the [Stop\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Stop-EC2Instance.html) command\.
1. Use the [Edit\-EC2InstancePlacement](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstancePlacement.html) command and specify the name of the placement group to which to move the instance\.
1. Start the instance using the [Start\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Start-EC2Instance.html) command\.
------
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
d4ece4732431-0 | **To remove an instance from a placement group using the AWS CLI**
1. Stop the instance using the [stop\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/stop-instances.html) command\.
1. Use the [modify\-instance\-placement](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-placement.html) command and specify an empty string for the placement group name\.
```
aws ec2 modify-instance-placement --instance-id i-0123a456700123456 --group-name ""
```
1. Start the instance using the [start\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/start-instances.html) command\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
9e7df8b4e4fd-0 | **To remove an instance from a placement group using the AWS Tools for Windows PowerShell**
1. Stop the instance using the [Stop\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Stop-EC2Instance.html) command\.
1. Use the [Edit\-EC2InstancePlacement](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2InstancePlacement.html) command and specify an empty string for the placement group name\.
1. Start the instance using the [Start\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Start-EC2Instance.html) command\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
0ce4421eed8a-0 | If you need to replace a placement group or no longer need one, you can delete it\. You can delete a placement group using one of the following methods\.
**Important**
Before you can delete a placement group, it must contain no instances\. You can [terminate](terminating-instances.md#terminating-instances-console) all instances that you launched into the placement group, [move](#move-instance-to-placement-group) them to another placement group, or [remove](#remove-instance-from-placement-group) them from the placement group\. You can verify that an instance is in a placement group before you terminate or move it by selecting the instance in the **Instances** screen and checking the value of **Placement group** in the details pane\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
5424b319978a-0 | **To delete a placement group 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 **Placement Groups**\.
1. Select the placement group and choose **Delete**\.
1. When prompted for confirmation, enter **Delete** and then choose **Delete**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
fdadaab2bf0f-0 | **To delete a placement group 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 **Placement Groups**\.
1. Select the placement group and choose **Delete Placement Group**\.
1. When prompted for confirmation, choose **Delete**\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
32d600edefa7-0 | **To delete a placement group using the AWS CLI**
Use the [delete\-placement\-group](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-placement-group.html) command and specify the placement group name to delete the placement group\. In this example, the placement group name is `my-cluster`\.
```
aws ec2 delete-placement-group --group-name my-cluster
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
c704b882dc7c-0 | **To delete a placement group using the AWS Tools for Windows PowerShell**
Use the [Remove\-EC2PlacementGroup](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2PlacementGroup.html) command to delete the placement group\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/placement-groups.md |
c61f358050d4-0 | *Instance metadata* is data about your instance that you can use to configure or manage the running instance\. Instance metadata is divided into categories, for example, host name, events, and security groups\.
You can also use instance metadata to access *user data* that you specified when launching your instance\. For example, you can specify parameters for configuring your instance, or include a simple script\. You can build generic AMIs and use user data to modify the configuration files supplied at launch time\. For example, if you run web servers for various small businesses, they can all use the same generic AMI and retrieve their content from the Amazon S3 bucket that you specify in the user data at launch\. To add a new customer at any time, create a bucket for the customer, add their content, and launch your AMI with the unique bucket name provided to your code in the user data\. If you launch more than one instance at the same time, the user data is available to all instances in that reservation\. Each instance that is part of the same reservation has a unique `ami-launch-index` number, allowing you to write code that controls what to do\. For example, the first host might elect itself as the original node in a cluster\. For a detailed AMI launch example, see [Example: AMI launch index value](AMI-launch-index-examples.md)\.
EC2 instances can also include *dynamic data*, such as an instance identity document that is generated when the instance is launched\. For more information, see [Dynamic data categories](instancedata-data-categories.md#dynamic-data-categories)\.
**Important** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-metadata.md |
c61f358050d4-1 | **Important**
Although you can only access instance metadata and user data from within the instance itself, the data is not protected by authentication or cryptographic methods\. Anyone who has direct access to the instance, and potentially any software running on the instance, can view its metadata\. Therefore, you should not store sensitive data, such as passwords or long\-lived encryption keys, as user data\.
**Topics**
+ [Configuring the instance metadata service](configuring-instance-metadata-service.md)
+ [Retrieving instance metadata](instancedata-data-retrieval.md)
+ [Working with instance user data](instancedata-add-user-data.md)
+ [Retrieving dynamic data](instancedata-dynamic-data-retrieval.md)
+ [Example: AMI launch index value](AMI-launch-index-examples.md)
+ [Instance metadata categories](instancedata-data-categories.md)
+ [Instance identity documents](instance-identity-documents.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-instance-metadata.md |
dc9ad3b8b394-0 | The AMI that you specify when you launch your instance determines the type of root device volume
To create an instance store\-backed Linux AMI, start from an instance that you've launched from an existing instance store\-backed Linux AMI\. After you've customized the instance to suit your needs, bundle the volume and register a new AMI, which you can use to launch new instances with these customizations\.
**Important**
Only the following instance types support an instance store volume as the root device: C3, D2, G2, I2, M3, and R3\.
The AMI creation process is different for Amazon EBS\-backed AMIs\. For more information about the differences between Amazon EBS\-backed and instance store\-backed instances, and how to determine the root device type for your instance, see [Storage for the root device](ComponentsAMIs.md#storage-for-the-root-device)\. If you need to create an Amazon EBS\-backed Linux AMI, see [Creating an Amazon EBS\-backed Linux AMI](creating-an-ami-ebs.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/creating-an-ami-instance-store.md |
cb216b7514d0-0 | The following diagram summarizes the process of creating an AMI from an instance store\-backed instance\.
![\[Creating an instance store-backed AMI\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/ami_create_instance_store.png)
First, launch an instance from an AMI that's similar to the AMI that you'd like to create\. You can connect to your instance and customize it\. When the instance is set up the way you want it, you can bundle it\. It takes several minutes for the bundling process to complete\. After the process completes, you have a bundle, which consists of an image manifest \(`image.manifest.xml`\) and files \(`image.part.`*xx*\) that contain a template for the root volume\. Next you upload the bundle to your Amazon S3 bucket and then register your AMI\.
When you launch an instance using the new AMI, we create the root volume for the instance using the bundle that you uploaded to Amazon S3\. The storage space used by the bundle in Amazon S3 incurs charges to your account until you delete it\. For more information, see [Deregistering your Linux AMI](deregister-ami.md)\.
If you add instance store volumes to your instance in addition to the root device volume, the block device mapping for the new AMI contains information for these volumes, and the block device mappings for instances that you launch from the new AMI automatically contain information for these volumes\. For more information, see [Block device mapping](block-device-mapping-concepts.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/creating-an-ami-instance-store.md |
d7ef524e81d6-0 | Before you can create an AMI, you must complete the following tasks:
+ Install the AMI tools\. For more information, see [Setting up the AMI tools](set-up-ami-tools.md)\.
+ Install the AWS CLI\. For more information, see [Getting Set Up with the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html)\.
+ Ensure that you have an Amazon S3 bucket for the bundle\. To create an Amazon S3 bucket, open the Amazon S3 console and click **Create Bucket**\. Alternatively, you can use the AWS CLI [mb](https://docs.aws.amazon.com/cli/latest/reference/s3/mb.html) command\.
+ Ensure that you have your AWS account ID\. For more information, see [AWS Account Identifiers](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) in the *AWS General Reference*\.
+ Ensure that you have your access key ID and secret access key\. For more information, see [Access Keys](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) in the *AWS General Reference*\.
+ Ensure that you have an X\.509 certificate and corresponding private key\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/creating-an-ami-instance-store.md |
d7ef524e81d6-1 | + Ensure that you have an X\.509 certificate and corresponding private key\.
+ If you need to create an X\.509 certificate, see [Managing signing certificates](set-up-ami-tools.md#ami-tools-managing-certs)\. The X\.509 certificate and private key are used to encrypt and decrypt your AMI\.
+ \[China \(Beijing\)\] Use the `$EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2-cn-north-1.pem` certificate\.
+ \[AWS GovCloud \(US\-West\)\] Use the `$EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2-gov.pem` certificate\.
+ Connect to your instance and customize it\. For example, you can install software and applications, copy data, delete temporary files, and modify the Linux configuration\.
**Tasks**
+ [Setting up the AMI tools](set-up-ami-tools.md)
+ [Creating an AMI from an instance store\-backed Amazon Linux instance](create-instance-store-ami.md#amazon_linux_instructions)
+ [Creating an AMI from an instance store\-backed Ubuntu instance](create-instance-store-ami.md#ubuntu_instructions)
+ [Converting your instance store\-backed AMI to an Amazon EBS\-backed AMI](Using_ConvertingS3toEBS.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/creating-an-ami-instance-store.md |
7112dd7e3314-0 | To help you manage your instances, images, and other Amazon EC2 resources, you can assign your own metadata to each resource in the form of *tags*\. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment\. This is useful when you have many resources of the same type—you can quickly identify a specific resource based on the tags that you've assigned to it\. This topic describes tags and shows you how to create them\.
**Warning**
Tag keys and their values are returned by many different API calls\. Denying access to `DescribeTags` doesn’t automatically deny access to tags returned by other APIs\. As a best practice, we recommend that you do not include sensitive data in your tags\.
**Topics**
+ [Tag basics](#tag-basics)
+ [Tagging your resources](#tag-resources)
+ [Tag restrictions](#tag-restrictions)
+ [Tagging your resources for billing](#tag-resources-for-billing)
+ [Working with tags using the console](#Using_Tags_Console)
+ [Working with tags using the command line](#Using_Tags_CLI)
+ [Adding tags to a resource using CloudFormation](#cloudformation-add-tag-specifications) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
40d7c68d48ab-0 | A tag is a label that you assign to an AWS resource\. Each tag consists of a *key* and an optional *value*, both of which you define\.
Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment\. For example, you could define a set of tags for your account's Amazon EC2 instances that helps you track each instance's owner and stack level\.
The following diagram illustrates how tagging works\. In this example, you've assigned two tags to each of your instances—one tag with the key `Owner` and another with the key `Stack`\. Each tag also has an associated value\.
![\[Tag example\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/Tag_Example.png)
We recommend that you devise a set of tag keys that meets your needs for each resource type\. Using a consistent set of tag keys makes it easier for you to manage your resources\. You can search and filter the resources based on the tags you add\. For more information about how to implement an effective resource tagging strategy, see the AWS whitepaper [Tagging Best Practices](https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
40d7c68d48ab-1 | Tags don't have any semantic meaning to Amazon EC2 and are interpreted strictly as a string of characters\. Also, tags are not automatically assigned to your resources\. You can edit tag keys and values, and you can remove tags from a resource at any time\. You can set the value of a tag to an empty string, but you can't set the value of a tag to null\. If you add a tag that has the same key as an existing tag on that resource, the new value overwrites the old value\. If you delete a resource, any tags for the resource are also deleted\.
You can work with tags using the AWS Management Console, the AWS CLI, and the Amazon EC2 API\.
If you're using AWS Identity and Access Management \(IAM\), you can control which users in your AWS account have permission to create, edit, or delete tags\. For more information, see [Identity and access management for Amazon EC2](security-iam.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
300282a32543-0 | You can tag most Amazon EC2 resources that already exist in your account\. The [table](#tag-ec2-resources-table) below lists the resources that support tagging\.
If you're using the Amazon EC2 console, you can apply tags to resources by using the **Tags** tab on the relevant resource screen, or you can use the **Tags** screen\. Some resource screens enable you to specify tags for a resource when you create the resource; for example, a tag with a key of `Name` and a value that you specify\. In most cases, the console applies the tags immediately after the resource is created \(rather than during resource creation\)\. The console may organize resources according to the `Name` tag, but this tag doesn't have any semantic meaning to the Amazon EC2 service\.
If you're using the Amazon EC2 API, the AWS CLI, or an AWS SDK, you can use the `CreateTags` EC2 API action to apply tags to existing resources\. Additionally, some resource\-creating actions enable you to specify tags for a resource when the resource is created\. If tags cannot be applied during resource creation, we roll back the resource creation process\. This ensures that resources are either created with tags or not created at all, and that no resources are left untagged at any time\. By tagging resources at the time of creation, you can eliminate the need to run custom tagging scripts after resource creation\.
The following table describes the Amazon EC2 resources that can be tagged, and the resources that can be tagged on creation using the Amazon EC2 API, the AWS CLI, or an AWS SDK\.
**Tagging support for Amazon EC2 resources** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
300282a32543-1 | **Tagging support for Amazon EC2 resources**
| Resource | Supports tags | Supports tagging on creation |
| --- | --- | --- |
| AFI | Yes | Yes |
| AMI | Yes | No |
| Bundle task | No | No |
| Capacity Reservation | Yes | Yes |
| Carrier gateway | Yes | Yes |
| Client VPN endpoint | Yes | Yes |
| Client VPN route | No | No |
| Customer gateway | Yes | Yes |
| Dedicated Host | Yes | Yes |
| Dedicated Host Reservation | Yes | Yes |
| DHCP option | Yes | Yes |
| EBS snapshot | Yes | Yes |
| EBS volume | Yes | Yes |
| EC2 Fleet | Yes | Yes |
| Egress\-only internet gateway | Yes | Yes |
| Elastic IP address | Yes | No |
| Elastic Graphics accelerator | Yes | No |
| Instance | Yes | Yes |
| Instance store volume | N/A | N/A |
| Internet gateway | Yes | Yes |
| IP address pool \(BYOIP\) | Yes | Yes |
| Key pair | Yes | Yes |
| Launch template | Yes | Yes |
| Launch template version | No | No |
| Local gateway | Yes | No |
| Local gateway route table | Yes | No | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
300282a32543-2 | | Launch template version | No | No |
| Local gateway | Yes | No |
| Local gateway route table | Yes | No |
| Local gateway virtual interface | Yes | No |
| Local gateway virtual interface group | Yes | No |
| Local gateway route table VPC association | Yes | No |
| Local gateway route table virtual interface group association | Yes | No |
| NAT gateway | Yes | Yes |
| Network ACL | Yes | Yes |
| Network interface | Yes | Yes |
| Placement group | Yes | Yes |
| Prefix list | Yes | Yes |
| Reserved Instance | Yes | No |
| Reserved Instance listing | No | No |
| Route table | Yes | Yes |
| Spot Fleet request | Yes | Yes |
| Spot Instance request | Yes | Yes |
| Security group | Yes | Yes |
| Subnet | Yes | Yes |
| Traffic Mirror filter | Yes | Yes |
| Traffic Mirror session | Yes | Yes |
| Traffic Mirror target | Yes | Yes |
| Transit gateway | Yes | Yes |
| Transit gateway route table | Yes | Yes |
| Transit gateway VPC attachment | Yes | Yes |
| Virtual private gateway | Yes | Yes |
| VPC | Yes | Yes |
| VPC endpoint | Yes | Yes |
| VPC endpoint service | Yes | Yes |
| VPC endpoint service configuration | Yes | Yes | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
300282a32543-3 | | VPC endpoint service | Yes | Yes |
| VPC endpoint service configuration | Yes | Yes |
| VPC flow log | Yes | Yes |
| VPC peering connection | Yes | Yes |
| VPN connection | Yes | Yes |
You can tag instances and volumes on creation using the Amazon EC2 Launch Instances wizard in the Amazon EC2 console\. You can tag your EBS volumes on creation using the Volumes screen, or EBS snapshots using the Snapshots screen\. Alternatively, use the resource\-creating Amazon EC2 APIs \(for example, [RunInstances](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html)\) to apply tags when creating your resource\.
You can apply tag\-based resource\-level permissions in your IAM policies to the Amazon EC2 API actions that support tagging on creation to implement granular control over the users and groups that can tag resources on creation\. Your resources are properly secured from creation—tags are applied immediately to your resources, therefore any tag\-based resource\-level permissions controlling the use of resources are immediately effective\. Your resources can be tracked and reported on more accurately\. You can enforce the use of tagging on new resources, and control which tag keys and values are set on your resources\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
300282a32543-4 | You can also apply resource\-level permissions to the `CreateTags` and `DeleteTags` Amazon EC2 API actions in your IAM policies to control which tag keys and values are set on your existing resources\. For more information, see [Example: Tagging resources](ExamplePolicies_EC2.md#iam-example-taggingresources)\.
For more information about tagging your resources for billing, see [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
52f77366b069-0 | The following basic restrictions apply to tags:
+ Maximum number of tags per resource – 50
+ For each resource, each tag key must be unique, and each tag key can have only one value\.
+ Maximum key length – 128 Unicode characters in UTF\-8
+ Maximum value length – 256 Unicode characters in UTF\-8
+ Although EC2 allows for any character in its tags, other services are more restrictive\. The allowed characters across services are: letters, numbers, and spaces representable in UTF\-8, and the following characters: \+ \- = \. \_ : / @\.
+ Tag keys and values are case\-sensitive\.
+ The `aws:` prefix is reserved for AWS use\. If a tag has a tag key with this prefix, then you can't edit or delete the tag's key or value\. Tags with the `aws:` prefix do not count against your tags per resource limit\.
You can't terminate, stop, or delete a resource based solely on its tags; you must specify the resource identifier\. For example, to delete snapshots that you tagged with a tag key called `DeleteMe`, you must use the `DeleteSnapshots` action with the resource identifiers of the snapshots, such as `snap-1234567890abcdef0`\.
You can tag public or shared resources, but the tags you assign are available only to your AWS account and not to the other accounts sharing the resource\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
52f77366b069-1 | You can tag public or shared resources, but the tags you assign are available only to your AWS account and not to the other accounts sharing the resource\.
You can't tag all resources\. For more information, see [Tagging support for Amazon EC2 resources](#tag-ec2-resources-table)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
e2b55a706fdc-0 | You can use tags to organize your AWS bill to reflect your own cost structure\. To do this, sign up to get your AWS account bill with tag key values included\. For more information about setting up a cost allocation report with tags, see [The Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) in *AWS Billing and Cost Management User Guide*\. To see the cost of your combined resources, you can organize your billing information based on resources that have the same tag key values\. For example, you can tag several resources with a specific application name, and then organize your billing information to see the total cost of that application across several services\. For more information, see [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\.
**Note**
If you've just enabled reporting, data for the current month is available for viewing after 24 hours\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
e2b55a706fdc-1 | **Note**
If you've just enabled reporting, data for the current month is available for viewing after 24 hours\.
Cost allocation tags can indicate which resources are contributing to costs, but deleting or deactivating resources doesn't always reduce costs\. For example, snapshot data that is referenced by another snapshot is preserved, even if the snapshot that contains the original data is deleted\. For more information, see [Amazon Elastic Block Store Volumes and Snapshots](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/checklistforunwantedcharges.html#checkebsvolumes) in the *AWS Billing and Cost Management User Guide*\.
**Note**
Elastic IP addresses that are tagged do not appear on your cost allocation report\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
7a74a7f8063c-0 | Using the Amazon EC2 console, you can see which tags are in use across all of your Amazon EC2 resources in the same Region\. You can view tags by resource and by resource type, and you can also view how many items of each resource type are associated with a specified tag\. You can also use the Amazon EC2 console to apply or remove tags from one or more resources at a time\.
For more information about using filters when listing your resources, see [Listing and filtering your resources](Using_Filtering.md)\.
For ease of use and best results, use Tag Editor in the AWS Management Console, which provides a central, unified way to create and manage your tags\. For more information, see [Working with Tag Editor](https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/tag-editor.html) in *Getting Started with the AWS Management Console*\.
**Topics**
+ [Displaying tags](#displaying-tags)
+ [Adding and deleting tags on an individual resource](#adding-or-deleting-tags)
+ [Adding and deleting tags to a group of resources](#adding-or-deleting-tags-group)
+ [Adding a tag when you launch an instance](#instance-details-tags)
+ [Filtering a list of resources by tag](#filtering-the-list-by-tag) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
a394058060f9-0 | You can display tags in two different ways in the Amazon EC2 console\. You can display the tags for an individual resource or for all resources\.
**Displaying tags for individual resources**
When you select a resource\-specific page in the Amazon EC2 console, it displays a list of those resources\. For example, if you select **Instances** from the navigation pane, the console displays a list of Amazon EC2 instances\. When you select a resource from one of these lists \(for example, an instance\), if the resource supports tags, you can view and manage its tags\. On most resource pages, you can view the tags in the **Tags** tab on the details pane\.
You can add a column to the resource list that displays all values for tags with the same key\. This column enables you to sort and filter the resource list by the tag\. There are two ways to add a new column to the resource list to display your tags\.
+ On the **Tags** tab, select **Show Column**\. A new column is added to the console\.
+ Choose the **Show/Hide Columns** gear\-shaped icon, and in the **Show/Hide Columns** dialog box, select the tag key under **Your Tag Keys**\.
**Displaying tags for all resources**
You can display tags across all resources by selecting **Tags** from the navigation pane in the Amazon EC2 console\. The following image shows the **Tags** pane, which lists all tags in use by resource type\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
a394058060f9-1 | ![\[The Tags pane in the Amazon EC2 console\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/Tags_Pane.png) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
6c6ba069bcf2-0 | You can manage tags for an individual resource directly from the resource's page\.
**To add a tag to an individual resource**
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 the Region that meets your needs\. This choice is important because some Amazon EC2 resources can be shared between Regions, while others can't\. For more information, see [Resource locations](resources.md)\.
1. In the navigation pane, select a resource type \(for example, **Instances**\)\.
1. Select the resource from the resource list and choose **Tags**, **Add/Edit Tags**\.
1. In the **Add/Edit Tags** dialog box, specify the key and value for each tag, and then choose **Save**\.
**To delete a tag from an individual resource**
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 the Region that meets your needs\. This choice is important because some Amazon EC2 resources can be shared between Regions, while others can't\. For more information, see [Resource locations](resources.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
6c6ba069bcf2-1 | 1. In the navigation pane, choose a resource type \(for example, **Instances**\)\.
1. Select the resource from the resource list and choose **Tags**\.
1. Choose **Add/Edit Tags**, select the **Delete** icon for the tag, and choose **Save**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
c148fd008dc1-0 | **To add a tag to a group of resources**
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 the Region that meets your needs\. This choice is important because some Amazon EC2 resources can be shared between Regions, while others can't\. For more information, see [Resource locations](resources.md)\.
1. In the navigation pane, choose **Tags**\.
1. At the top of the content pane, choose **Manage Tags**\.
1. For **Filter**, select the type of resource \(for example, instances\) to which to add tags\.
1. In the resources list, select the check box next to each resource to which to add tags\.
1. Under **Add Tag**, for **Key** and **Value**, type the tag key and values, and then choose **Add Tag**\.
**Note**
If you add a new tag with the same tag key as an existing tag, the new tag overwrites the existing tag\.
**To remove a tag from a group of resources**
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
c148fd008dc1-1 | 1. From the navigation bar, select the Region that meets your needs\. This choice is important because some Amazon EC2 resources can be shared between Regions, while others can't\. For more information, see [Resource locations](resources.md)\.
1. In the navigation pane, choose **Tags**, **Manage Tags**\.
1. To view the tags in use, select the **Show/Hide Columns** gear\-shaped icon, and in the **Show/Hide Columns** dialog box, select the tag keys to view and choose **Close**\.
1. For **Filter**, select the type of resource \(for example, instances\) from which to remove tags\.
1. In the resource list, select the check box next to each resource from which to remove tags\.
1. Under **Remove Tag**, for **Key**, type the tag's name and choose **Remove Tag**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
20918e4942f5-0 | **To add a tag using the Launch Wizard**
1. From the navigation bar, select the Region for the instance\. This choice is important because some Amazon EC2 resources can be shared between Regions, while others can't\. Select the Region that meets your needs\. For more information, see [Resource locations](resources.md)\.
1. Choose **Launch Instance**\.
1. The **Choose an Amazon Machine Image \(AMI\)** page displays a list of basic configurations called Amazon Machine Images \(AMIs\)\. Select the AMI to use and choose **Select**\. For more information about selecting an AMI, see [Finding a Linux AMI](finding-an-ami.md)\.
1. On the **Configure Instance Details** page, configure the instance settings as necessary, and then choose **Next: Add Storage**\.
1. On the **Add Storage** page, you can specify additional storage volumes for your instance\. Choose **Next: Add Tags** when done\.
1. On the **Add Tags** page, specify tags for the instance, the volumes, or both\. Choose **Add another tag** to add more than one tag to your instance\. Choose **Next: Configure Security Group** when you are done\.
1. On the **Configure Security Group** page, you can choose from an existing security group that you own, or let the wizard create a new security group for you\. Choose **Review and Launch** when you are done\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
20918e4942f5-1 | 1. Review your settings\. When you're satisfied with your selections, choose **Launch**\. Select an existing key pair or create a new one, select the acknowledgment check box, and then choose **Launch Instances**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
913e78083978-0 | You can filter your list of resources based on one or more tag keys and tag values\.
**To filter a list of resources by tag**
1. Display a column for the tag as follows:
1. Select a resource\.
1. In the details pane, choose **Tags**\.
1. Locate the tag in the list and choose **Show Column**\.
1. Choose the filter icon in the top right corner of the column for the tag to display the filter list\.
1. Select the tag values, and then choose **Apply Filter** to filter the results list\.
**Note**
For more information about filters, see [Listing and filtering your resources](Using_Filtering.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
1102720dea60-0 | You can add tags to many EC2 resource when you create them, using the tag specifications parameter for the create command\. You can view the tags for a resource using the describe command for the resource\. You can also add, update, or delete tags for your existing resources using the following commands\.
| Task | AWS CLI | AWS Tools for Windows PowerShell |
| --- | --- | --- |
| Add or overwrite one or more tags | [create\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html) | [New\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Tag.html) |
| Delete one or more tags | [delete\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-tags.html) | [Remove\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2Tag.html) |
| Describe one or more tags | [describe\-tags](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-tags.html) | [Get\-EC2Tag](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Tag.html) |
**Topics** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
1102720dea60-1 | **Topics**
+ [Adding tags on resource creation](#tag-on-create-examples)
+ [Adding tags to an existing resource](#create-tag-examples)
+ [Describing tagged resources](#describe-tag-examples) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
51f625d0f4d6-0 | The following examples demonstrate how to apply tags when you create resources\.
The way you enter JSON\-formatted parameters on the command line differs depending on your operating system\. Linux, macOS, or Unix and Windows PowerShell use single quotes \('\) to enclose the JSON data structure\. Omit the single quotes when using the commands with the Windows command line\. For more information, see [Specifying Parameter Values for the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html)\.
**Example: Launch an instance and apply tags to the instance and volume**
The following [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command launches an instance and applies a tag with the key **webserver** and the value **production** to the instance\. The command also applies a tag with the key **cost\-center** and the value **cc123** to any EBS volume that's created \(in this case, the root volume\)\.
```
aws ec2 run-instances \
--image-id ami-abc12345 \
--count 1 \
--instance-type t2.micro \
--key-name MyKeyPair \
--subnet-id subnet-6e7f829e \ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
51f625d0f4d6-1 | --key-name MyKeyPair \
--subnet-id subnet-6e7f829e \
--tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]'
```
You can apply the same tag keys and values to both instances and volumes during launch\. The following command launches an instance and applies a tag with a key of **cost\-center** and a value of **cc123** to both the instance and any EBS volume that's created\.
```
aws ec2 run-instances \
--image-id ami-abc12345 \
--count 1 \
--instance-type t2.micro \
--key-name MyKeyPair \
--subnet-id subnet-6e7f829e \
--tag-specifications 'ResourceType=instance,Tags=[{Key=cost-center,Value=cc123}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]'
```
**Example: Create a volume and apply a tag** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/Using_Tags.md |
Subsets and Splits