id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
90f553446088-1 | 1. <a name="grub-install-step"></a>Install the `grub` package using the following command\.
```
ubuntu:~$ sudo apt-get install -y grub
```
1. <a name="partition"></a>Install the following partition management packages using the package manager for your distribution\.
+ `gdisk` \(some distributions may call this package `gptfdisk` instead\)
+ `kpartx`
+ `parted`
Use the following command\.
```
ubuntu:~$ sudo apt-get install -y gdisk kpartx parted
```
1. Check the kernel parameters for your instance\.
```
ubuntu:~$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.2.0-54-virtual root=UUID=4f392932-ed93-4f8f-aee7-72bc5bb6ca9d ro console=ttyS0 xen_emul_unplug=unnecessary
```
Note the options following the kernel and root device parameters: `ro`, `console=ttyS0`, and `xen_emul_unplug=unnecessary`\. Your options may differ\.
1. Check the kernel entries in `/boot/grub/menu.lst`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-2 | 1. Check the kernel entries in `/boot/grub/menu.lst`\.
```
ubuntu:~$ grep ^kernel /boot/grub/menu.lst
kernel /boot/vmlinuz-3.2.0-54-virtual root=LABEL=cloudimg-rootfs ro console=hvc0
kernel /boot/vmlinuz-3.2.0-54-virtual root=LABEL=cloudimg-rootfs ro single
kernel /boot/memtest86+.bin
```
Note that the `console` parameter is pointing to `hvc0` instead of `ttyS0` and that the `xen_emul_unplug=unnecessary` parameter is missing\. Again, your options may differ\.
1. Edit the `/boot/grub/menu.lst` file with your favorite text editor \(such as vim or nano\) to change the console and add the parameters you identified earlier to the boot entries\.
```
title Ubuntu 12.04.3 LTS, kernel 3.2.0-54-virtual
root (hd0)
kernel /boot/vmlinuz-3.2.0-54-virtual root=LABEL=cloudimg-rootfs ro console=ttyS0 xen_emul_unplug=unnecessary
initrd /boot/initrd.img-3.2.0-54-virtual | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-3 | initrd /boot/initrd.img-3.2.0-54-virtual
title Ubuntu 12.04.3 LTS, kernel 3.2.0-54-virtual (recovery mode)
root (hd0)
kernel /boot/vmlinuz-3.2.0-54-virtual root=LABEL=cloudimg-rootfs ro single console=ttyS0 xen_emul_unplug=unnecessary
initrd /boot/initrd.img-3.2.0-54-virtual
title Ubuntu 12.04.3 LTS, memtest86+
root (hd0)
kernel /boot/memtest86+.bin
```
1. Verify that your kernel entries now contain the correct parameters\.
```
ubuntu:~$ grep ^kernel /boot/grub/menu.lst
kernel /boot/vmlinuz-3.2.0-54-virtual root=LABEL=cloudimg-rootfs ro console=ttyS0 xen_emul_unplug=unnecessary
kernel /boot/vmlinuz-3.2.0-54-virtual root=LABEL=cloudimg-rootfs ro single console=ttyS0 xen_emul_unplug=unnecessary
kernel /boot/memtest86+.bin
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-4 | kernel /boot/memtest86+.bin
```
1. \[For Ubuntu 14\.04 and later only\] Starting with Ubuntu 14\.04, instance store backed Ubuntu AMIs use a GPT partition table and a separate EFI partition mounted at `/boot/efi`\. The ec2\-bundle\-vol command will not bundle this boot partition, so you need to comment out the `/etc/fstab` entry for the EFI partition as shown in the following example\.
```
LABEL=cloudimg-rootfs / ext4 defaults 0 0
#LABEL=UEFI /boot/efi vfat defaults 0 0
/dev/xvdb /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
```
**To create an AMI from an instance store\-backed Ubuntu instance**
This procedure assumes that you have satisfied the prerequisites in [Prerequisites](creating-an-ami-instance-store.md#bundle-ami-prerequisites)\.
1. Upload your credentials to your instance\. We use these credentials to ensure that only you and Amazon EC2 can access your AMI\.
1. Create a temporary directory on your instance for your credentials as follows:
```
ubuntu:~$ mkdir /tmp/cert
```
This enables you to exclude your credentials from the created image\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-5 | ```
This enables you to exclude your credentials from the created image\.
1. Copy your X\.509 certificate and private key from your computer to the `/tmp/cert` directory on your instance, using a secure copy tool such as [scp](AccessingInstancesLinux.md#AccessingInstancesLinuxSCP)\. The `-i my-private-key.pem` option in the following scp command is the private key you use to connect to your instance with SSH, not the X\.509 private key\. For example:
```
you@your_computer:~ $ scp -i my-private-key.pem /path/to/pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem /path/to/cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem [email protected]:/tmp/cert/
pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem 100% 717 0.7KB/s 00:00
cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem 100% 685 0.7KB/s 00:00
```
Alternatively, because these are plain text files, you can open the certificate and key in a text editor and copy their contents into new files in `/tmp/cert`\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-6 | Alternatively, because these are plain text files, you can open the certificate and key in a text editor and copy their contents into new files in `/tmp/cert`\.
1. <a name="step_with_bundle_path_ubuntu"></a>Prepare the bundle to upload to Amazon S3 by running the [ec2\-bundle\-vol](ami-tools-commands.md#ami-bundle-vol) command from your instance\. Be sure to specify the `-e` option to exclude the directory where your credentials are stored\. By default, the bundle process excludes files that might contain sensitive information\. These files include `*.sw`, `*.swo`, `*.swp`, `*.pem`, `*.priv`, `*id_rsa*`, `*id_dsa*` `*.gpg`, `*.jks`, `*/.ssh/authorized_keys`, and `*/.bash_history`\. To include all of these files, use the `--no-filter` option\. To include some of these files, use the `--include` option\.
**Important** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-7 | **Important**
By default, the AMI bundling process creates a compressed, encrypted collection of files in the `/tmp` directory that represents your root volume\. If you do not have enough free disk space in `/tmp` to store the bundle, you need to specify a different location for the bundle to be stored with the `-d /path/to/bundle/storage` option\. Some instances have ephemeral storage mounted at `/mnt` or `/media/ephemeral0` that you can use, or you can also [create](ebs-creating-volume.md), [attach](ebs-attaching-volume.md), and [mount](ebs-using-volumes.md) a new Amazon EBS volume to store the bundle\.
1. You must run the ec2\-bundle\-vol command needs as root\. For most commands, you can use sudo to gain elevated permissions, but in this case, you should run sudo \-E su to keep your environment variables\.
```
ubuntu:~$ sudo -E su
```
Note that bash prompt now identifies you as the root user, and that the dollar sign has been replaced by a hash tag, signalling that you are in a root shell:
```
root@ubuntu:#
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-8 | ```
root@ubuntu:#
```
1. <a name="create_bundle_Ubuntu_Linux_step"></a>To create the AMI bundle, run the [ec2\-bundle\-vol](ami-tools-commands.md#ami-bundle-vol) command as follows\.
```
root@ubuntu:# ec2-bundle-vol -k /tmp/cert/pk-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -c /tmp/cert/cert-HKZYKTAIG2ECMXYIBH3HXV4ZBEXAMPLE.pem -u your_aws_account_id -r x86_64 -e /tmp/cert --partition gpt
```
**Important**
For Ubuntu 14\.04 and later HVM instances, add the `--partition mbr` flag to bundle the boot instructions properly; otherwise, your newly\-created AMI will not boot\.
It can take a few minutes to create the image\. When this command completes, your `tmp` directory contains the bundle \(`image.manifest.xml`, plus multiple `image.part.`*xx* files\)\.
1. Exit from the root shell\.
```
root@ubuntu:# exit
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-9 | 1. Exit from the root shell\.
```
root@ubuntu:# exit
```
1. \(Optional\) To add more instance store volumes, edit the block device mappings in the `image.manifest.xml` file for your AMI\. For more information, see [Block device mapping](block-device-mapping-concepts.md)\.
1. Create a backup of your `image.manifest.xml` file\.
```
ubuntu:~$ sudo cp /tmp/image.manifest.xml /tmp/image.manifest.xml.bak
```
1. Reformat the `image.manifest.xml` file so that it is easier to read and edit\.
```
ubuntu:~$ sudo xmllint --format /tmp/image.manifest.xml.bak > /tmp/image.manifest.xml
```
1. Edit the block device mappings in `image.manifest.xml` with a text editor\. The example below shows a new entry for the *ephemeral1* instance store volume\.
```
<block_device_mapping>
<mapping>
<virtual>ami</virtual>
<device>sda</device>
</mapping>
<mapping>
<virtual>ephemeral0</virtual>
<device>sdb</device>
</mapping> | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-10 | <virtual>ephemeral0</virtual>
<device>sdb</device>
</mapping>
<mapping>
<virtual>ephemeral1</virtual>
<device>sdc</device>
</mapping>
<mapping>
<virtual>root</virtual>
<device>/dev/sda1</device>
</mapping>
</block_device_mapping>
```
1. Save the `image.manifest.xml` file and exit your text editor\.
1. To upload your bundle to Amazon S3, run the [ec2\-upload\-bundle](ami-tools-commands.md#ami-upload-bundle) command as follows\.
```
ubuntu:~$ ec2-upload-bundle -b my-s3-bucket/bundle_folder/bundle_name -m /tmp/image.manifest.xml -a your_access_key_id -s your_secret_access_key
```
**Important**
If you intend to register your AMI in a Region other than US East \(N\. Virginia\), you must specify both the target Region with the `--region` option and a bucket path that already exists in the target Region or a unique bucket path that can be created in the target Region\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-11 | 1. \(Optional\) After the bundle is uploaded to Amazon S3, you can remove the bundle from the `/tmp` directory on the instance using the following rm command:
```
ubuntu:~$ sudo rm /tmp/image.manifest.xml /tmp/image.part.* /tmp/image
```
**Important**
If you specified a path with the `-d /path/to/bundle/storage` option in [Step 2](#step_with_bundle_path_ubuntu), use that same path below, instead of `/tmp`\.
1. To register your AMI, run the [register\-image](https://docs.aws.amazon.com/cli/latest/reference/ec2/register-image.html) AWS CLI command as follows\.
```
ubuntu:~$ aws ec2 register-image --image-location my-s3-bucket/bundle_folder/bundle_name/image.manifest.xml --name AMI_name --virtualization-type hvm
```
**Important**
If you previously specified a Region for the [ec2\-upload\-bundle](ami-tools-commands.md#ami-upload-bundle) command, specify that Region again for this command\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
90f553446088-12 | 1. \[Ubuntu 14\.04 and later\] Uncomment the EFI entry in `/etc/fstab`; otherwise, your running instance will not be able to reboot\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/create-instance-store-ami.md |
356de1afae56-0 | Amazon EC2 and Amazon VPC support both the IPv4 and IPv6 addressing protocols\. By default, Amazon EC2 and Amazon VPC use the IPv4 addressing protocol; you can't disable this behavior\. When you create a VPC, you must specify an IPv4 CIDR block \(a range of private IPv4 addresses\)\. You can optionally assign an IPv6 CIDR block to your VPC and subnets, and assign IPv6 addresses from that block to instances in your subnet\. IPv6 addresses are reachable over the Internet\. For more information about IPv6, see [IP Addressing in Your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html) in the *Amazon VPC User Guide*\.
**Topics**
+ [Private IPv4 addresses and internal DNS hostnames](#concepts-private-addresses)
+ [Public IPv4 addresses and external DNS hostnames](#concepts-public-addresses)
+ [Elastic IP addresses \(IPv4\)](#ip-addressing-eips)
+ [Amazon DNS server](#amazon-dns-server)
+ [IPv6 addresses](#ipv6-addressing)
+ [Working with IP addresses for your instance](#working-with-ip-addresses)
+ [Multiple IP addresses](MultipleIP.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
40f3c8095727-0 | A private IPv4 address is an IP address that's not reachable over the Internet\. You can use private IPv4 addresses for communication between instances in the same VPC\. For more information about the standards and specifications of private IPv4 addresses, see [RFC 1918](http://www.faqs.org/rfcs/rfc1918.html)\. We allocate private IPv4 addresses to instances using DHCP\.
**Note**
You can create a VPC with a publicly routable CIDR block that falls outside of the private IPv4 address ranges specified in RFC 1918\. However, for the purposes of this documentation, we refer to private IPv4 addresses \(or 'private IP addresses'\) as the IP addresses that are within the IPv4 CIDR range of your VPC\.
When you launch an instance, we allocate a primary private IPv4 address for the instance\. Each instance is also given an internal DNS hostname that resolves to the primary private IPv4 address; for example, `ip-10-251-50-12.ec2.internal`\. You can use the internal DNS hostname for communication between instances in the same VPC, but we can't resolve the internal DNS hostname outside of the VPC\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
40f3c8095727-1 | An instance receives a primary private IP address from the IPv4 address range of the subnet\. For more information, see [VPC and subnet sizing](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#VPC_Sizing) in the *Amazon VPC User Guide*\. If you don't specify a primary private IP address when you launch the instance, we select an available IP address in the subnet's IPv4 range for you\. Each instance has a default network interface \(eth0\) that is assigned the primary private IPv4 address\. You can also specify additional private IPv4 addresses, known as *secondary private IPv4 addresses*\. Unlike primary private IP addresses, secondary private IP addresses can be reassigned from one instance to another\. For more information, see [Multiple IP addresses](MultipleIP.md)\.
A private IPv4 address, regardless of whether it is a primary or secondary address, remains associated with the network interface when the instance is stopped and started, or hibernated and started, and is released when the instance is terminated\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
a96fc3e9b26e-0 | A public IP address is an IPv4 address that's reachable from the Internet\. You can use public addresses for communication between your instances and the Internet\.
Each instance that receives a public IP address is also given an external DNS hostname; for example, `ec2-203-0-113-25.compute-1.amazonaws.com`\. We resolve an external DNS hostname to the public IP address of the instance from outside its VPC, and to the private IPv4 address of the instance from inside its VPC\. The public IP address is mapped to the primary private IP address through network address translation \(NAT\)\. For more information, see [RFC 1631: The IP Network Address Translator \(NAT\)](http://www.faqs.org/rfcs/rfc1631.html)\.
When you launch an instance in a default VPC, we assign it a public IP address by default\. When you launch an instance into a nondefault VPC, the subnet has an attribute that determines whether instances launched into that subnet receive a public IP address from the public IPv4 address pool\. By default, we don't assign a public IP address to instances launched in a nondefault subnet\.
You can control whether your instance receives a public IP address as follows:
+ Modifying the public IP addressing attribute of your subnet\. For more information, see [Modifying the public IPv4 addressing attribute for your subnet](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip) in the *Amazon VPC User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
a96fc3e9b26e-1 | + Enabling or disabling the public IP addressing feature during launch, which overrides the subnet's public IP addressing attribute\. For more information, see [Assigning a public IPv4 address during instance launch](#public-ip-addresses)\.
A public IP address is assigned to your instance from Amazon's pool of public IPv4 addresses, and is not associated with your AWS account\. When a public IP address is disassociated from your instance, it is released back into the public IPv4 address pool, and you cannot reuse it\.
You cannot manually associate or disassociate a public IP address from your instance\. Instead, in certain cases, we release the public IP address from your instance, or assign it a new one:
+ We release your instance's public IP address when it is stopped, hibernated, or terminated\. Your stopped or hibernated instance receives a new public IP address when it is started\.
+ We release your instance's public IP address when you associate an Elastic IP address with it\. When you disassociate the Elastic IP address from your instance, it receives a new public IP address\.
+ If the public IP address of your instance in a VPC has been released, it will not receive a new one if there is more than one network interface attached to your instance\.
+ If your instance's public IP address is released while it has a secondary private IP address that is associated with an Elastic IP address, the instance does not receive a new public IP address\.
If you require a persistent public IP address that can be associated to and from instances as you require, use an Elastic IP address instead\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
a96fc3e9b26e-2 | If you require a persistent public IP address that can be associated to and from instances as you require, use an Elastic IP address instead\.
If you use dynamic DNS to map an existing DNS name to a new instance's public IP address, it might take up to 24 hours for the IP address to propagate through the Internet\. As a result, new instances might not receive traffic while terminated instances continue to receive requests\. To solve this problem, use an Elastic IP address\. You can allocate your own Elastic IP address, and associate it with your instance\. For more information, see [Elastic IP addresses](elastic-ip-addresses-eip.md)\.
If you assign an Elastic IP address to an instance, it receives an IPv4 DNS hostname if DNS hostnames are enabled\. For more information, see [Using DNS with your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html) in the *Amazon VPC User Guide*\.
**Note**
Instances that access other instances through their public NAT IP address are charged for regional or Internet data transfer, depending on whether the instances are in the same Region\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
75c9255647ce-0 | An Elastic IP address is a public IPv4 address that you can allocate to your account\. You can associate it to and from instances as you require, and it's allocated to your account until you choose to release it\. For more information about Elastic IP addresses and how to use them, see [Elastic IP addresses](elastic-ip-addresses-eip.md)\.
We do not support Elastic IP addresses for IPv6\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
4f2c40f2e595-0 | Amazon provides a DNS server that resolves Amazon\-provided IPv4 DNS hostnames to IPv4 addresses\. The Amazon DNS server is located at the base of your VPC network range plus two\. For more information, see [Amazon DNS server](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html#AmazonDNS) in the *Amazon VPC User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
490d6e000f49-0 | You can optionally associate an IPv6 CIDR block with your VPC, and associate IPv6 CIDR blocks with your subnets\. The IPv6 CIDR block for your VPC is automatically assigned from Amazon's pool of IPv6 addresses; you cannot choose the range yourself\. For more information, see the following topics in the *Amazon VPC User Guide*:
+ [VPC and subnet sizing for IPv6](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#vpc-sizing-ipv6)
+ [Associating an IPv6 CIDR block with your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-vpcs.html#vpc-associate-ipv6-cidr)
+ [Associating an IPv6 CIDR block with your subnet](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-vpcs.html#subnet-associate-ipv6-cidr)
IPv6 addresses are globally unique, and therefore reachable over the Internet\. Your instance receives an IPv6 address if an IPv6 CIDR block is associated with your VPC and subnet, and if one of the following is true: | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
490d6e000f49-1 | + Your subnet is configured to automatically assign an IPv6 address to an instance during launch\. For more information, see [Modifying the IPv6 addressing attribute for your subnet](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-ipv6)\.
+ You assign an IPv6 address to your instance during launch\.
+ You assign an IPv6 address to the primary network interface of your instance after launch\.
+ You assign an IPv6 address to a network interface in the same subnet, and attach the network interface to your instance after launch\.
When your instance receives an IPv6 address during launch, the address is associated with the primary network interface \(eth0\) of the instance\. You can disassociate the IPv6 address from the network interface\. We do not support IPv6 DNS hostnames for your instance\.
An IPv6 address persists when you stop and start, or hibernate and start, your instance, and is released when you terminate your instance\. You cannot reassign an IPv6 address while it's assigned to another network interface—you must first unassign it\.
You can assign additional IPv6 addresses to your instance by assigning them to a network interface attached to your instance\. The number of IPv6 addresses you can assign to a network interface and the number of network interfaces you can attach to an instance varies per instance type\. For more information, see [IP addresses per network interface per instance type](using-eni.md#AvailableIpPerENI)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
9128196264cd-0 | You can view the IP addresses assigned to your instance, assign a public IPv4 address to your instance during launch, or assign an IPv6 address to your instance during launch\.
**Topics**
+ [Determining your public, private, and Elastic IP addresses](#using-instance-addressing-common)
+ [Determining your IPv6 addresses](#view-ipv6-addresses)
+ [Assigning a public IPv4 address during instance launch](#public-ip-addresses)
+ [Assigning an IPv6 address to an instance](#assign-ipv6-address)
+ [Unassigning an IPv6 address from an instance](#unassign-ipv6-address) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
de78fef85385-0 | You can use the Amazon EC2 console to determine the private IPv4 addresses, public IPv4 addresses, and Elastic IP addresses of your instances\. You can also determine the public IPv4 and private IPv4 addresses of your instance from within your instance by using instance metadata\. For more information, see [Instance metadata and user data](ec2-instance-metadata.md)\.
**To determine your instance's private IPv4 addresses 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 your instance\. In the details pane, get the private IPv4 address from the **Private IPs** field, and get the internal DNS hostname from the **Private DNS** field\.
1. If you have one or more secondary private IPv4 addresses assigned to network interfaces that are attached to your instance, get those IP addresses from the **Secondary private IPs** field\.
1. Alternatively, in the navigation pane, choose **Network Interfaces**, and then select the network interface that's associated with your instance\.
1. Get the primary private IP address from the **Primary private IPv4 IP** field, and the internal DNS hostname from the **Private DNS \(IPv4\)** field\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
de78fef85385-1 | 1. If you've assigned secondary private IP addresses to the network interface, get those IP addresses from the **Secondary private IPv4 IPs** field\.
**To determine your instance's public IPv4 addresses 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 your instance\. In the details pane, get the public IP address from the **IPv4 Public IP** field, and get the external DNS hostname from the **Public DNS \(IPv4\)** field\.
1. If one or more Elastic IP addresses have been associated with the instance, get the Elastic IP addresses from the **Elastic IPs** field\.
**Note**
If your instance does not have a public IPv4 address, but you've associated an Elastic IP address with a network interface for the instance, the **IPv4 Public IP** field displays the Elastic IP address\.
1. Alternatively, in the navigation pane, choose **Network Interfaces**, and then select a network interface that's associated with your instance\.
1. Get the public IP address from the **IPv4 Public IP** field\. An asterisk \(\*\) indicates the public IPv4 address or Elastic IP address that's mapped to the primary private IPv4 address\.
**Note** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
de78fef85385-2 | **Note**
The public IPv4 address is displayed as a property of the network interface in the console, but it's mapped to the primary private IPv4 address through NAT\. Therefore, if you inspect the properties of your network interface on your instance, for example, through `ifconfig` \(Linux\) or `ipconfig` \(Windows\), the public IPv4 address is not displayed\. To determine your instance's public IPv4 address from within the instance, you can use instance metadata\.
**To determine your instance's IPv4 addresses using instance metadata**
1. Connect to your instance\. For more information, see [Connect to your Linux instance](AccessingInstances.md)\.
1. Use the following command to access the private IP address:
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
5f0fb34d0f13-0 | ```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/local-ipv4
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
a8112af859b1-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/local-ipv4
```
------
1. Use the following command to access the public IP address:
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
69fcaef7da88-0 | ```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/public-ipv4
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
87b72535a0f0-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/public-ipv4
```
------
Note that if an Elastic IP address is associated with the instance, the value returned is that of the Elastic IP address\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
b9a64e736786-0 | You can use the Amazon EC2 console to determine the IPv6 addresses of your instances\.
**To determine your instance's IPv6 addresses 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 your instance\. In the details pane, get the IPv6 addresses from **IPv6 IPs**\.
**To determine your instance's IPv6 addresses using instance metadata**
1. Connect to your instance\. For more information, see [Connect to your Linux instance](AccessingInstances.md)\.
1. Use the following command to view the IPv6 address \(you can get the MAC address from `http://169.254.169.254/latest/meta-data/network/interfaces/macs/`\)\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
b38dd3edd256-0 | ```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/network/interfaces/macs/mac-address/ipv6s
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
5d78e4807d63-0 | ```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/mac-address/ipv6s
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
457ad0a42120-0 | Each subnet has an attribute that determines whether instances launched into that subnet are assigned a public IP address\. By default, nondefault subnets have this attribute set to false, and default subnets have this attribute set to true\. When you launch an instance, a public IPv4 addressing feature is also available for you to control whether your instance is assigned a public IPv4 address; you can override the default behavior of the subnet's IP addressing attribute\. The public IPv4 address is assigned from Amazon's pool of public IPv4 addresses, and is assigned to the network interface with the device index of eth0\. This feature depends on certain conditions at the time you launch your instance\.
**Important**
You can't manually disassociate the public IP address from your instance after launch\. Instead, it's automatically released in certain cases, after which you cannot reuse it\. For more information, see [Public IPv4 addresses and external DNS hostnames](#concepts-public-addresses)\. If you require a persistent public IP address that you can associate or disassociate at will, assign an Elastic IP address to the instance after launch instead\. For more information, see [Elastic IP addresses](elastic-ip-addresses-eip.md)\.
**To access the public IP addressing feature when launching an instance**
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. Choose **Launch Instance**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
457ad0a42120-1 | 1. Choose **Launch Instance**\.
1. Select an AMI and an instance type, and then choose **Next: Configure Instance Details**\.
1. On the **Configure Instance Details** page, for **Network**, select a VPC\. The **Auto\-assign Public IP** list is displayed\. Choose **Enable** or **Disable** to override the default setting for the subnet\.
**Important**
You cannot auto\-assign a public IP address if you specify more than one network interface\. Additionally, you cannot override the subnet setting using the auto\-assign public IP feature if you specify an existing network interface for eth0\.
1. Follow the steps on the next pages of the wizard to complete your instance's setup\. For more information about the wizard configuration options, see [Launching an instance using the Launch Instance Wizard](launching-instance.md)\. On the final **Review Instance Launch** page, review your settings, and then choose **Launch** to choose a key pair and launch your instance\.
1. On the **Instances** page, select your new instance and view its public IP address in **IPv4 Public IP** field in the details pane\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
457ad0a42120-2 | The public IP addressing feature is only available during launch\. However, whether you assign a public IP address to your instance during launch or not, you can associate an Elastic IP address with your instance after it's launched\. For more information, see [Elastic IP addresses](elastic-ip-addresses-eip.md)\. You can also modify your subnet's public IPv4 addressing behavior\. For more information, see [Modifying the public IPv4 addressing attribute for your subnet](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip)\.<a name="publicip-cli"></a>
**To enable or disable the public IP addressing feature using the command line**
You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\.
+ Use the `--associate-public-ip-address` or the `--no-associate-public-ip-address` option with the [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command \(AWS CLI\)
+ Use the `-AssociatePublicIp` parameter with the [New\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) command \(AWS Tools for Windows PowerShell\) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
35216e245f19-0 | If your VPC and subnet have IPv6 CIDR blocks associated with them, you can assign an IPv6 address to your instance during or after launch\. The IPv6 address is assigned from the IPv6 address range of the subnet, and is assigned to the network interface with the device index of eth0\.
IPv6 is supported on all current generation instance types and the C3, R3, and I2 previous generation instance types\.
**To assign an IPv6 address to an instance during launch**
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. Select an AMI and an instance type that supports IPv6, and choose **Next: Configure Instance Details**\.
1. On the **Configure Instance Details** page, for **Network**, select a VPC and for **Subnet**, select a subnet\. For **Auto\-assign IPv6 IP**, choose **Enable**\.
1. Follow the remaining steps in the wizard to launch your instance\.
Alternatively, you can assign an IPv6 address to your instance after launch\.
**To assign an IPv6 address to your instance after launch**
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-instance-addressing.md |
35216e245f19-1 | 1. In the navigation pane, choose **Instances**\.
1. Select your instance, choose **Actions**, **Networking**, **Manage IP Addresses**\.
1. Under **IPv6 Addresses**, choose **Assign new IP**\. You can specify an IPv6 address from the range of the subnet, or leave the **Auto\-assign** value to let Amazon choose an IPv6 address for you\.
1. Choose **Save**\.
**Note**
If you launched your instance using Amazon Linux 2016\.09\.0 or later, or Windows Server 2008 R2 or later, your instance is configured for IPv6, and no additional steps are needed to ensure that the IPv6 address is recognized on the instance\. If you launched your instance from an older AMI, you may have to configure your instance manually\. For more information, see [Configure IPv6 on your instances](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-migrate-ipv6.html#vpc-migrate-ipv6-dhcpv6) in the *Amazon VPC User Guide*\.<a name="assign-ipv6-cli"></a>
**To assign an IPv6 address using the command line**
You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
35216e245f19-2 | + Use the `--ipv6-addresses` option with the [run\-instances](https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html) command \(AWS CLI\)
+ Use the `Ipv6Addresses` property for `-NetworkInterface` in the [New\-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) command \(AWS Tools for Windows PowerShell\)
+ [assign\-ipv6\-addresses](https://docs.aws.amazon.com/cli/latest/reference/ec2/assign-ipv6-addresses.html) \(AWS CLI\)
+ [Register\-EC2Ipv6AddressList](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2Ipv6AddressList.html) \(AWS Tools for Windows PowerShell\) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
39b876a98365-0 | You can unassign an IPv6 address from an instance using the Amazon EC2 console\.
**To unassign an IPv6 address from 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 **Instances**\.
1. Select your instance, choose **Actions**, **Networking**, **Manage IP Addresses**\.
1. Under **IPv6 Addresses**, choose **Unassign** for the IPv6 address to unassign\.
1. Choose **Yes, Update**\.
**To unassign an IPv6 address using the command line**
You can use one of the following commands\. For more information about these command line interfaces, see [Accessing Amazon EC2](concepts.md#access-ec2)\.
+ [unassign\-ipv6\-addresses](https://docs.aws.amazon.com/cli/latest/reference/ec2/unassign-ipv6-addresses.html) \(AWS CLI\) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
39b876a98365-1 | + [Unregister\-EC2Ipv6AddressList](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2Ipv6AddressList.html) \(AWS Tools for Windows PowerShell\)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/using-instance-addressing.md |
1ef2e9633292-0 | AWS provides a free reporting tool called AWS Cost Explorer that enables you to analyze the cost and usage of your EC2 instances and the usage of your Reserved Instances\. You can view data up to the last 13 months, and forecast how much you are likely to spend for the next three months\. You can use Cost Explorer to see patterns in how much you spend on AWS resources over time, identify areas that need further inquiry, and see trends that you can use to understand your costs\. You also can specify time ranges for the data, and view time data by day or by month\.
Here's an example of some of the questions that you can answer when using Cost Explorer:
+ How much am I spending on instances of each instance type?
+ How many instance hours are being used by a particular department?
+ How is my instance usage distributed across Availability Zones?
+ How is my instance usage distributed across AWS accounts?
+ How well am I using my Reserved Instances?
+ Are my Reserved Instances helping me save money?
For more information about working with reports in Cost Explorer, including saving reports, see [Analyzing your costs with Cost Explorer](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-explorer-what-is.html)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/usage-reports.md |
4366fde9c3a8-0 | This topic explains how to verify the instance identity document using the PKCS7 signature and the AWS DSA public certificate\.
**To verify the instance identity document using the PKCS7 signature and the AWS DSA public certificate**
1. Connect to the instance\.
1. Retrieve the PKCS7 signature from the instance metadata and add it to a file named `pkcs7`\.
1. Add the `-----BEGIN PKCS7-----` header to the `pkcs7` file\.
```
$ echo "-----BEGIN PKCS7-----" > pkcs7
```
1. Retrieve the PKCS7 signature from the instance metadata and append it to the `pkcs7` file\. Use one of the following commands depending on the IMDS version used by the instance\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
f16198fc8fff-0 | ```
$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/dynamic/instance-identity/pkcs7 >> pkcs7
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
cbbf82d7094f-0 | ```
$ curl -s http://169.254.169.254/latest/dynamic/instance-identity/pkcs7 >> pkcs7
```
------
1. Append the `-----END PKCS7-----` footer to a new line in the `pkcs7` file\.
```
$ echo "" >> pkcs7
$ echo "-----END PKCS7-----" >> pkcs7
```
1. Add the contents of the instance identity document from the instance metadata to a file named `document`\. Use one of the following commands depending on the IMDS version used by the instance\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
28195763ab1c-0 | ```
$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \ && curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/dynamic/instance-identity/document > document
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
dbea05939260-0 | ```
$ curl -s http://169.254.169.254/latest/dynamic/instance-identity/document > document
```
------
1. Add the AWS DSA public certificate to a file named `certificate`\.
1. Create the `certificate` file\.
```
$ touch certificate
```
1. Open the `certificate` file using your preferred text editor and add the contents of the AWS DSA public certificate\. Choose the correct certificate for the AWS Region that your instance is in\.
**Important**
If the AWS DSA public certificate for your Region is not listed below, contact [AWS Support](https://console.aws.amazon.com/support/home#/)\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
4481d85435f1-0 | The following AWS public certificate is for all AWS Regions, except Hong Kong, Bahrain, China, and GovCloud\.
```
-----BEGIN CERTIFICATE-----
MIIC7TCCAq0CCQCWukjZ5V4aZzAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xMjAxMDUxMjU2MTJaFw0z
ODAxMDUxMjU2MTJaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQCjkvcS2bb1VQ4yt/5e
ih5OO6kK/n1Lzllr7D8ZwtQP8fOEpp5E2ng+D6Ud1Z1gYipr58Kj3nssSNpI6bX3 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
4481d85435f1-1 | VyIQzK7wLclnd/YozqNNmgIyZecN7EglK9ITHJLP+x8FtUpt3QbyYXJdmVMegN6P
hviYt5JH/nYl4hh3Pa1HJdskgQIVALVJ3ER11+Ko4tP6nwvHwh6+ERYRAoGBAI1j
k+tkqMVHuAFcvAGKocTgsjJem6/5qomzJuKDmbJNu9Qxw3rAotXau8Qe+MBcJl/U
hhy1KHVpCGl9fueQ2s6IL0CaO/buycU1CiYQk40KNHCcHfNiZbdlx1E9rpUp7bnF
lRa2v1ntMX3caRVDdbtPEWmdxSCYsYFDk4mZrOLBA4GEAAKBgEbmeve5f8LIE/Gf
MNmP9CM5eovQOGx5ho8WqD+aTebs+k2tn92BBPqeZqpWRa5P/+jrdKml1qx4llHW
MXrs3IgIb6+hUIB+S8dz8/mmO0bpr76RoZVCXYab2CZedFut7qc3WUH9+EUAH5mw
vSeDCOUMYQR7R9LINYwouHIziqQYMAkGByqGSM44BAMDLwAwLAIUWXBlk40xTwSw | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
4481d85435f1-2 | 7HX32MxXYruse9ACFBNGmdX2ZBrVNGrN9N2f6ROk0k9K
-----END CERTIFICATE-----
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
ba4c08aaf1c4-0 | The AWS public certificate for the Hong Kong Region is as follows\.
```
-----BEGIN CERTIFICATE-----
MIIC7zCCAq4CCQCO7MJe5Y3VLjAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xOTAyMDMwMjIxMjFaFw00
NTAyMDMwMjIxMjFaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbgwggEsBgcqhkjOOAQBMIIBHwKBgQDvQ9RzVvf4MAwGbqfX
blCvCoVb9957OkLGn/04CowHXJ+vTBR7eyIa6AoXltsQXBOmrJswToFKKxT4gbuw | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
ba4c08aaf1c4-1 | jK7s9QQX4CmTRWcEgO2RXtZSVjOhsUQMh+yf7Ht4OVL97LWnNfGsX2cwjcRWHYgI
7lvnuBNBzLQHdSEwMNq0Bk76PwIVAMan6XIEEPnwr4e6u/RNnWBGKd9FAoGBAOCG
eSNmxpW4QFu4pIlAykm6EnTZKKHT87gdXkAkfoC5fAfOxxhnE2HezZHp9Ap2tMV5
8bWNvoPHvoKCQqwfm+OUBlAxC/3vqoVkKL2mG1KgUH9+hrtpMTkwO3RREnKe7I5O
x9qDimJpOihrL4I0dYvy9xUOoz+DzFAW8+ylWVYpA4GFAAKBgQDbnBAKSxWr9QHY
6Dt+EFdGz6lAZLedeBKpaP53Z1DTO34J0C55YbJTwBTFGqPtOLxnUVDlGiD6GbmC
80f3jvogPR1mSmGsydbNbZnbUEVWrRhe+y5zJ3g9qs/DWmDW0deEFvkhWVnLJkFJ
9pdOu/ibRPH1lE2nz6pK7GbOQtLyHTAJBgcqhkjOOAQDAzAAMC0CFQCoJlwGtJQC | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
ba4c08aaf1c4-2 | cLoM4p/jtVFOj26xbgIUUS4pDKyHaG/eaygLTtFpFJqzWHc=
-----END CERTIFICATE-----
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
be33d4ab5528-0 | The AWS public certificate for the Bahrain Region is as follows\.
```
-----BEGIN CERTIFICATE-----
MIIC7jCCAq4CCQCVWIgSmP8RhTAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xOTAyMDUxMzA2MjFaFw00
NTAyMDUxMzA2MjFaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbgwggEsBgcqhkjOOAQBMIIBHwKBgQDcwojQfgWdV1QliO0B
8n6cLZ38VE7ZmrjZ9OQV//Gst6S1h7euhC23YppKXi1zovefSDwFU54zi3/oJ++q | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
be33d4ab5528-1 | PHlP1WGL8IZ34BUgRTtG4TVolvp0smjkMvyRu5hIdKtzjV93Ccx15gVgyk+o1IEG
fZ2Kbw/Dd8JfoPS7KaSCmJKxXQIVAIZbIaDFRGa2qcMkW2HWASyNDl7bAoGBANtz
IdhfMq+l2I5iofY2oj3HI21Kj3LtZrWEg3W+/4rVhL3lTm0Nne1rl9yGujrjQwy5
Zp9V4A/w9w2O10Lx4K6hj34Eefy/aQnZwNdNhv/FQP7Az0fju+Yl6L13OOHQrL0z
Q+9cF7zEosekEnBQx3v6psNknKgD3Shgx+GO/LpCA4GFAAKBgQCVS7m77nuNAlZ8
wvUqcooxXMPkxJFl54NxAsAul9KP9KN4svm0O3Zrb7t2FOtXRM8zU3TqMpryq1o5
mpMPsZDg6RXo9BF7Hn0DoZ6PJTamkFA6md+NyTJWJKvXC7iJ8fGDBJqTciUHuCKr
12AztQ8bFWsrTgTzPE3p6U5ckcgV1TAJBgcqhkjOOAQDAy8AMCwCFB2NZGWm5EDl | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
be33d4ab5528-2 | 86ayV3c1PEDukgQIAhQow38rQkN/VwHVeSW9DqEshXHjuQ==
-----END CERTIFICATE-----
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
d108358cb4f5-0 | The AWS public certificate for the AWS GovCloud Regions is as follows\.
```
-----BEGIN CERTIFICATE-----
MIIC7TCCAq0CCQCWukjZ5V4aZzAJBgcqhkjOOAQDMFwxCzAJBgNVBAYTAlVTMRkw
FwYDVQQIExBXYXNoaW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYD
VQQKExdBbWF6b24gV2ViIFNlcnZpY2VzIExMQzAeFw0xMjAxMDUxMjU2MTJaFw0z
ODAxMDUxMjU2MTJaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNoaW5ndG9u
IFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24gV2ViIFNl
cnZpY2VzIExMQzCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQCjkvcS2bb1VQ4yt/5e
ih5OO6kK/n1Lzllr7D8ZwtQP8fOEpp5E2ng+D6Ud1Z1gYipr58Kj3nssSNpI6bX3 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
d108358cb4f5-1 | VyIQzK7wLclnd/YozqNNmgIyZecN7EglK9ITHJLP+x8FtUpt3QbyYXJdmVMegN6P
hviYt5JH/nYl4hh3Pa1HJdskgQIVALVJ3ER11+Ko4tP6nwvHwh6+ERYRAoGBAI1j
k+tkqMVHuAFcvAGKocTgsjJem6/5qomzJuKDmbJNu9Qxw3rAotXau8Qe+MBcJl/U
hhy1KHVpCGl9fueQ2s6IL0CaO/buycU1CiYQk40KNHCcHfNiZbdlx1E9rpUp7bnF
lRa2v1ntMX3caRVDdbtPEWmdxSCYsYFDk4mZrOLBA4GEAAKBgEbmeve5f8LIE/Gf
MNmP9CM5eovQOGx5ho8WqD+aTebs+k2tn92BBPqeZqpWRa5P/+jrdKml1qx4llHW
MXrs3IgIb6+hUIB+S8dz8/mmO0bpr76RoZVCXYab2CZedFut7qc3WUH9+EUAH5mw
vSeDCOUMYQR7R9LINYwouHIziqQYMAkGByqGSM44BAMDLwAwLAIUWXBlk40xTwSw | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
d108358cb4f5-2 | 7HX32MxXYruse9ACFBNGmdX2ZBrVNGrN9N2f6ROk0k9K
-----END CERTIFICATE-----
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
ff87cba1a1c9-0 | The AWS public certificate for the China \(Beijing\) and China \(Ningxia\) Regions is as follows\.
```
-----BEGIN CERTIFICATE-----
MIIDNjCCAh4CCQD3yZ1w1AVkTzANBgkqhkiG9w0BAQsFADBcMQswCQYDVQQGEwJV
UzEZMBcGA1UECBMQV2FzaGluZ3RvbiBTdGF0ZTEQMA4GA1UEBxMHU2VhdHRsZTEg
MB4GA1UEChMXQW1hem9uIFdlYiBTZXJ2aWNlcyBMTEMwIBcNMTUwNTEzMDk1OTE1
WhgPMjE5NDEwMTYwOTU5MTVaMFwxCzAJBgNVBAYTAlVTMRkwFwYDVQQIExBXYXNo
aW5ndG9uIFN0YXRlMRAwDgYDVQQHEwdTZWF0dGxlMSAwHgYDVQQKExdBbWF6b24g
V2ViIFNlcnZpY2VzIExMQzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AMWk9vyppSmDU3AxZ2Cy2bvKeK3F1UqNpMuyeriizi+NTsZ8tQqtNloaQcqhto/l | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
ff87cba1a1c9-1 | gsw9+QSnEJeYWnmivJWOBdn9CyDpN7cpHVmeGgNJL2fvImWyWe2f2Kq/BL9l7N7C
P2ZT52/sH9orlck1n2zO8xPi7MItgPHQwu3OxsGQsAdWucdxjHGtdchulpo1uJ31
jsTAPKZ3p1/sxPXBBAgBMatPHhRBqhwHO/Twm4J3GmTLWN7oVDds4W3bPKQfnw3r
vtBj/SM4/IgQ3xJslFcl90TZbQbgxIi88R/gWTbs7GsyT2PzstU30yLdJhKfdZKz
/aIzraHvoDTWFaOdy0+OOaECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAdSzN2+0E
V1BfR3DPWJHWRf1b7zl+1X/ZseW2hYE5r6YxrLv+1VPf/L5I6kB7GEtqhZUqteY7
zAceoLrVu/7OynRyfQetJVGichaaxLNM3lcr6kcxOowb+WQQ84cwrB3keykH4gRX | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
ff87cba1a1c9-2 | KHB2rlWSxta+2panSEO1JX2q5jhcFP90rDOtZjlpYv57N/Z9iQ+dvQPJnChdq3BK
5pZlnIDnVVxqRike7BFy8tKyPj7HzoPEF5mh9Kfnn1YoSVu+61lMVv/qRjnyKfS9
c96nE98sYFj0ZVBzXw8Sq4Gh8FiVmFHbQp1peGC19idOUqxPxWsasWxQXO0azYsP
9RyWLHKxH1dMuA==
-----END CERTIFICATE-----
```
------
1. Save and close the file\.
1. Use the **OpenSSL smime** command to verify the signature\. Include the `-verify` option to indicate that the signature needs to be verified, and the `-noverify` option to indicate that the certificate does not need to be verified\.
```
$ openssl smime -verify -in pkcs7 -inform PEM -content document -certfile certificate -noverify
```
If the signature is valid, the `Verification successful` message appears\. If the signature cannot be verified, contact AWS Support\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/verify-pkcs7.md |
5813b423968a-0 | If you purchase a Reserved Instance and you already have a running instance that matches the specifications of the Reserved Instance, the billing benefit is immediately applied\. You do not have to restart your instances\. If you do not have an eligible running instance, launch an instance and ensure that you match the same criteria that you specified for your Reserved Instance\. For more information, see [Using your Reserved Instances](ri-market-concepts-buying.md#reserved-instances-process)\.
Reserved Instances apply to usage in the same manner, irrespective of the offering type \(Standard or Convertible\), and are automatically applied to running On\-Demand Instances with matching attributes\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
6f2131953870-0 | Reserved Instances assigned to a specific Availability Zone provide the Reserved Instance discount to matching instance usage in that Availability Zone\. For example, if you purchase two `c4.xlarge` default tenancy Linux/Unix Standard Reserved Instances in Availability Zone us\-east\-1a, then up to two `c4.xlarge` default tenancy Linux/Unix instances running in the Availability Zone us\-east\-1a can benefit from the Reserved Instance discount\. The attributes \(tenancy, platform, Availability Zone, instance type, and instance size\) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
6f2131953870-1 | Availability Zone, instance type, and instance size\) of the running instances must match that of the Reserved Instances\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
9c2cd7c3b708-0 | Regional Reserved Instances are purchased for a Region and provide Availability Zone flexibility\. The Reserved Instance discount applies to instance usage in any Availability Zone in that Region\.
Regional Reserved Instances also provide instance size flexibility where the Reserved Instance discount applies to instance usage within the instance family, regardless of size\.
**Limitations for instance size flexibility**
Instance size flexibility does not apply to the following Reserved Instances:
+ Reserved Instances that are purchased for a specific Availability Zone \(zonal Reserved Instances\)
+ Reserved Instances with dedicated tenancy
+ Reserved Instances for Windows Server, Windows Server with SQL Standard, Windows Server with SQL Server Enterprise, Windows Server with SQL Server Web, RHEL, and SUSE Linux Enterprise Server
+ Reserved Instances for G4 instances | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
3fdd48a8762d-0 | Instance size flexibility is determined by the normalization factor of the instance size\. The discount applies either fully or partially to running instances of the same instance family, depending on the instance size of the reservation, in any Availability Zone in the Region\. The only attributes that must be matched are the instance family, tenancy, and platform\.
Instance size flexibility is applied from the smallest to the largest instance size within the instance family based on the normalization factor\.
The following table lists the different sizes within an instance family, and the corresponding normalization factor per hour\. This scale is used to apply the discounted rate of Reserved Instances to the normalized usage of the instance family\.
| Instance size | Normalization factor |
| --- | --- |
| nano | 0\.25 |
| micro | 0\.5 |
| small | 1 |
| medium | 2 |
| large | 4 |
| xlarge | 8 |
| 2xlarge | 16 |
| 3xlarge | 24 |
| 4xlarge | 32 |
| 6xlarge | 48 |
| 8xlarge | 64 |
| 9xlarge | 72 |
| 10xlarge | 80 |
| 12xlarge | 96 |
| 16xlarge | 128 |
| 18xlarge | 144 |
| 24xlarge | 192 |
| 32xlarge | 256 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
3fdd48a8762d-1 | | 18xlarge | 144 |
| 24xlarge | 192 |
| 32xlarge | 256 |
For example, a `t2.medium` instance has a normalization factor of 2\. If you purchase a `t2.medium` default tenancy Amazon Linux/Unix Reserved Instance in the US East \(N\. Virginia\) and you have two running `t2.small` instances in your account in that Region, the billing benefit is applied in full to both instances\.
![\[Applying a Regional Reserved Instance\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/ri-instance-flex-full.png)
Or, if you have one `t2.large` instance running in your account in the US East \(N\. Virginia\) Region, the billing benefit is applied to 50% of the usage of the instance\.
![\[Applying a Regional Reserved Instance\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/ri-instance-flex-partial.png)
The normalization factor is also applied when modifying Reserved Instances\. For more information, see [Modifying Reserved Instances](ri-modifying.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
3d36b9d82667-0 | Instance size flexibility also applies to bare metal instances within the instance family\. If you have regional Amazon Linux/Unix Reserved Instances with shared tenancy on bare metal instances, you can benefit from the Reserved Instance savings within the same instance family\. The opposite is also true: if you have regional Amazon Linux/Unix Reserved Instances with shared tenancy on instances in the same family as a bare metal instance, you can benefit from the Reserved Instance savings on the bare metal instance\.
A bare metal instance is the same size as the largest instance within the same instance family\. For example, an `i3.metal` is the same size as an `i3.16xlarge`, so they have the same normalization factor\.
**Note**
The `.metal` instance sizes do not have a single normalization factor\. They vary based on the specific instance family\.
| Bare metal instance size | Normalization factor |
| --- | --- |
| a1\.metal | 32 |
| c5\.metal | 192 |
| c5d\.metal | 192 |
| c5n\.metal | 144 |
| c6g\.metal | 128 |
| c6gd\.metal | 128 |
| g4dn\.metal | 128 |
| i3\.metal | 128 |
| i3en\.metal | 192 |
| m5\.metal | 192 |
| m5d\.metal | 192 |
| m6g\.metal | 128 | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
3d36b9d82667-1 | | m5\.metal | 192 |
| m5d\.metal | 192 |
| m6g\.metal | 128 |
| m6gd\.metal | 128 |
| r5\.metal | 192 |
| r5d\.metal | 192 |
| r6g\.metal | 128 |
| r6gd\.metal | 128 |
| z1d\.metal | 96 |
For example, an `i3.metal` instance has a normalization factor of 128\. If you purchase an `i3.metal` default tenancy Amazon Linux/Unix Reserved Instance in the US East \(N\. Virginia\), the billing benefit can apply as follows:
+ If you have one running `i3.16xlarge` in your account in that Region, the billing benefit is applied in full to the `i3.16xlarge` instance \(`i3.16xlarge` normalization factor = 128\)\.
+ Or, if you have two running `i3.8xlarge` instances in your account in that Region, the billing benefit is applied in full to both `i3.8xlarge` instances \(`i3.8xlarge` normalization factor = 64\)\.
+ Or, if you have four running `i3.4xlarge` instances in your account in that Region, the billing benefit is applied in full to all four `i3.4xlarge` instances \(`i3.4xlarge` normalization factor = 32\)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
3d36b9d82667-2 | The opposite is also true\. For example, if you purchase two `i3.8xlarge` default tenancy Amazon Linux/Unix Reserved Instances in the US East \(N\. Virginia\), and you have one running `i3.metal` instance in that Region, the billing benefit is applied in full to the `i3.metal` instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
c31820ab5cce-0 | The following scenarios cover the ways in which Reserved Instances are applied\.
**Example Scenario 1: Reserved Instances in a single account**
You are running the following On\-Demand Instances in account A:
+ 4 x `m3.large` Linux, default tenancy instances in Availability Zone us\-east\-1a
+ 2 x `m4.xlarge` Amazon Linux, default tenancy instances in Availability Zone us\-east\-1b
+ 1 x `c4.xlarge` Amazon Linux, default tenancy instances in Availability Zone us\-east\-1c
You purchase the following Reserved Instances in account A:
+ 4 x `m3.large` Linux, default tenancy Reserved Instances in Availability Zone us\-east\-1a \(capacity is reserved\)
+ 4 x `m4.large` Amazon Linux, default tenancy Reserved Instances in Region us\-east\-1
+ 1 x `c4.large` Amazon Linux, default tenancy Reserved Instances in Region us\-east\-1
The Reserved Instance benefits are applied in the following way:
+ The discount and capacity reservation of the four `m3.large` zonal Reserved Instances is used by the four `m3.large` instances because the attributes \(instance size, Region, platform, tenancy\) between them match\.
+ The `m4.large` regional Reserved Instances provide Availability Zone and instance size flexibility, because they are regional Amazon Linux Reserved Instances with default tenancy\.
An `m4.large` is equivalent to 4 normalized units/hour\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
c31820ab5cce-1 | An `m4.large` is equivalent to 4 normalized units/hour\.
You've purchased four `m4.large` regional Reserved Instances, and in total, they are equal to 16 normalized units/hour \(4x4\)\. Account A has two `m4.xlarge` instances running, which is equivalent to 16 normalized units/hour \(2x8\)\. In this case, the four `m4.large` regional Reserved Instances provide the billing benefit to an entire hour of usage of the two `m4.xlarge` instances\.
+ The `c4.large` regional Reserved Instance in us\-east\-1 provides Availability Zone and instance size flexibility, because it is a regional Amazon Linux Reserved Instance with default tenancy, and applies to the `c4.xlarge` instance\. A `c4.large` instance is equivalent to 4 normalized units/hour and a `c4.xlarge` is equivalent to 8 normalized units/hour\.
In this case, the `c4.large` regional Reserved Instance provides partial benefit to `c4.xlarge` usage\. This is because the `c4.large` Reserved Instance is equivalent to 4 normalized units/hour of usage, but the `c4.xlarge` instance requires 8 normalized units/hour\. Therefore, the `c4.large` Reserved Instance billing discount applies to 50% of `c4.xlarge` usage\. The remaining `c4.xlarge` usage is charged at the On\-Demand rate\.
**Example Scenario 2: Regional Reserved Instances in linked accounts** | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
c31820ab5cce-2 | **Example Scenario 2: Regional Reserved Instances in linked accounts**
Reserved Instances are first applied to usage within the purchasing account, followed by qualifying usage in any other account in the organization\. For more information, see [Reserved Instances and consolidated billing](concepts-reserved-instances-application.md#concepts-reserved-instances-billing)\. For regional Reserved Instances that offer instance size flexibility, the benefit is applied from the smallest to the largest instance size within the instance family\.
You're running the following On\-Demand Instances in account A \(the purchasing account\):
+ 2 x `m4.xlarge` Linux, default tenancy instances in Availability Zone us\-east\-1a
+ 1 x `m4.2xlarge` Linux, default tenancy instances in Availability Zone us\-east\-1b
+ 2 x `c4.xlarge` Linux, default tenancy instances in Availability Zone us\-east\-1a
+ 1 x `c4.2xlarge` Linux, default tenancy instances in Availability Zone us\-east\-1b
Another customer is running the following On\-Demand Instances in account B—a linked account:
+ 2 x `m4.xlarge` Linux, default tenancy instances in Availability Zone us\-east\-1a
You purchase the following regional Reserved Instances in account A:
+ 4 x `m4.xlarge` Linux, default tenancy Reserved Instances in Region us\-east\-1
+ 2 x `c4.xlarge` Linux, default tenancy Reserved Instances in Region us\-east\-1 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
c31820ab5cce-3 | + 2 x `c4.xlarge` Linux, default tenancy Reserved Instances in Region us\-east\-1
The regional Reserved Instance benefits are applied in the following way:
+ The discount of the four `m4.xlarge` Reserved Instances is used by the two `m4.xlarge` instances and the single `m4.2xlarge` instance in account A \(purchasing account\)\. All three instances match the attributes \(instance family, Region, platform, tenancy\)\. The discount is applied to instances in the purchasing account \(account A\) first, even though account B \(linked account\) has two `m4.xlarge` that also match the Reserved Instances\. There is no capacity reservation because the Reserved Instances are regional Reserved Instances\.
+ The discount of the two `c4.xlarge` Reserved Instances applies to the two `c4.xlarge` instances, because they are a smaller instance size than the `c4.2xlarge` instance\. There is no capacity reservation because the Reserved Instances are regional Reserved Instances\.
**Example Scenario 3: Zonal Reserved Instances in a linked account**
In general, Reserved Instances that are owned by an account are applied first to usage in that account\. However, if there are qualifying, unused Reserved Instances for a specific Availability Zone \(zonal Reserved Instances\) in other accounts in the organization, they are applied to the account before regional Reserved Instances owned by the account\. This is done to ensure maximum Reserved Instance utilization and a lower bill\. For billing purposes, all the accounts in the organization are treated as one account\. The following example may help explain this\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
c31820ab5cce-4 | You're running the following On\-Demand Instance in account A \(the purchasing account\):
+ 1 x `m4.xlarge` Linux, default tenancy instance in Availability Zone us\-east\-1a
A customer is running the following On\-Demand Instance in linked account B:
+ 1 x `m4.xlarge` Linux, default tenancy instance in Availability Zone us\-east\-1b
You purchase the following regional Reserved Instances in account A:
+ 1 x `m4.xlarge` Linux, default tenancy Reserved Instance in Region us\-east\-1
A customer also purchases the following zonal Reserved Instances in linked account C:
+ 1 x `m4.xlarge` Linux, default tenancy Reserved Instances in Availability Zone us\-east\-1a
The Reserved Instance benefits are applied in the following way:
+ The discount of the `m4.xlarge` zonal Reserved Instance owned by account C is applied to the `m4.xlarge` usage in account A\.
+ The discount of the `m4.xlarge` regional Reserved Instance owned by account A is applied to the `m4.xlarge` usage in account B\.
+ If the regional Reserved Instance owned by account A was first applied to the usage in account A, the zonal Reserved Instance owned by account C remains unused and usage in account B is charged at On\-Demand rates\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
c31820ab5cce-5 | For more information, see [Reserved Instances in the Billing and Cost Management Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-reports.html#enhanced-RI)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/apply_ri.md |
a776bf53868d-0 | Amazon EFS provides scalable file storage for use with Amazon EC2\. You can create an EFS file system and configure your instances to mount the file system\. You can use an EFS file system as a common data source for workloads and applications running on multiple instances\. For more information, see the [Amazon Elastic File System product page](https://aws.amazon.com/efs)\.
In this tutorial, you create an EFS file system and two Linux instances that can share data using the file system\.
**Important**
Amazon EFS is not supported on Windows instances\.
**Topics**
+ [Prerequisites](#efs-prerequisites)
+ [Step 1: Create an EFS File System](#efs-create-file-system)
+ [Step 2: Mount the File System](#efs-mount-file-system)
+ [Step 3: Test the File System](#efs-test-file-system)
+ [Step 4: Clean Up](#efs-clean-up) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
0565665bf511-0 | + Create a security group \(for example, efs\-sg\) to associate with the EC2 instances and EFS mount target, and add the following rules:
+ Allow inbound SSH connections to the EC2 instances from your computer \(the source is the CIDR block for your network\)\.
+ Allow inbound NFS connections to the file system via the EFS mount target from the EC2 instances that are associated with this security group \(the source is the security group itself\)\. For more information, see [Amazon EFS rules](security-group-rules-reference.md#sg-rules-efs), and [Creating security Groups](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-create-security-groups.html) in the *Amazon Elastic File System User Guide*\.
+ Create a key pair\. You must specify a key pair when you configure your instances or you can't connect to them\. For more information, see [Create a key pair](get-set-up-for-amazon-ec2.md#create-a-key-pair)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
fd59c14da3be-0 | Amazon EFS enables you to create a file system that multiple instances can mount and access at the same time\. For more information, see [Creating Resources for Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/creating-using.html) in the *Amazon Elastic File System User Guide*\.
**To create a file system**
1. Open the Amazon Elastic File System console at [https://console\.aws\.amazon\.com/efs/](https://console.aws.amazon.com/efs/)\.
1. Choose **Create file system**\.
1. \(Optional\) For **Name**, type a name for the file system\. This creates a tag with **Name** as the key and the name of the file system as the value\.
1. For **Virtual Private Cloud**, select the VPC to use for your instances\.
1. Choose **Create**\.
1. After the file system is created, note the file system ID, as you'll use it later in this tutorial\.
1. From the file systems page, choose **Network**, **Create mount target**\. For each Availability Zone for your instances, choose **Add mount target** and provide the requested information\. Ensure that the value for **Security group** is the security group that you created in [Prerequisites](#efs-prerequisites)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
71b57d99d329-0 | Use the following procedure to launch two `t2.micro` instances\. The user data script mounts the file system to both instances during launch and updates /etc/fstab to ensure that the file system is remounted after an instance reboot\. Note that T2 instances must be launched in a subnet\. You can use a default VPC or a nondefault VPC\.
**Note**
There are other ways that you can mount the volume \(for example, on an already running instance\)\. For more information, see [Mounting File Systems](https://docs.aws.amazon.com/efs/latest/ug/mounting-fs.html) in the *Amazon Elastic File System User Guide*\.
**To launch two instances and mount an EFS file system**
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. Choose **Launch Instance**\.
1. On the **Choose an Amazon Machine Image** page, select an Amazon Linux AMI with the HVM virtualization type\.
1. On the **Choose an Instance Type** page, keep the default instance type, `t2.micro` and choose **Next: Configure Instance Details**\.
1. On the **Configure Instance Details** page, do the following:
1. For **Number of instances**, type 2\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
71b57d99d329-1 | 1. For **Number of instances**, type 2\.
1. \[Default VPC\] If you have a default VPC, it is the default value for **Network**\. Keep the default VPC and the default value for **Subnet** to use the default subnet in the Availability Zone that Amazon EC2 chooses for your instances\.
\[Nondefault VPC\] Select your VPC for **Network** and a public subnet from **Subnet**\.
1. \[Nondefault VPC\] For **Auto\-assign Public IP**, choose **Enable**\. Otherwise, your instances do not get public IP addresses or public DNS names\.
1. Under **Advanced Details**, select **As text**, and paste the following script into **User data**\. Update **FILE\_SYSTEM\_ID** with the ID of your file system\. You can optionally update **MOUNT\_POINT** with a directory for your mounted file system\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
6b7749e52af3-0 | ```
#!/bin/bash
yum update -y
yum install -y nfs-utils
FILE_SYSTEM_ID=fs-xxxxxxxx
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
AVAILABILITY_ZONE=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
REGION=${AVAILABILITY_ZONE:0:-1}
MOUNT_POINT=/mnt/efs
mkdir -p ${MOUNT_POINT}
chown ec2-user:ec2-user ${MOUNT_POINT}
echo ${FILE_SYSTEM_ID}.efs.${REGION}.amazonaws.com:/ ${MOUNT_POINT} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0 >> /etc/fstab
mount -a -t nfs4
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
a4cef5103e27-0 | ```
#!/bin/bash
yum update -y
yum install -y nfs-utils
FILE_SYSTEM_ID=fs-xxxxxxxx
AVAILABILITY_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone )
REGION=${AVAILABILITY_ZONE:0:-1}
MOUNT_POINT=/mnt/efs
mkdir -p ${MOUNT_POINT}
chown ec2-user:ec2-user ${MOUNT_POINT}
echo ${FILE_SYSTEM_ID}.efs.${REGION}.amazonaws.com:/ ${MOUNT_POINT} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0 >> /etc/fstab
mount -a -t nfs4
```
------
1. Advance to Step 6 of the wizard\.
1. On the **Configure Security Group** page, choose **Select an existing security group** and select the security group that you created in [Prerequisites](#efs-prerequisites), and then choose **Review and Launch**\.
1. On the **Review Instance Launch** page, choose **Launch**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
a4cef5103e27-1 | 1. On the **Review Instance Launch** page, choose **Launch**\.
1. In the **Select an existing key pair or create a new key pair** dialog box, select **Choose an existing key pair** and choose your key pair\. Select the acknowledgment check box, and choose **Launch Instances**\.
1. In the navigation pane, choose **Instances** to see the status of your instances\. Initially, their status is `pending`\. After the status changes to `running`, your instances are ready for use\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
583621254380-0 | You can connect to your instances and verify that the file system is mounted to the directory that you specified \(for example, /mnt/efs\)\.
**To verify that the file system is mounted**
1. Connect to your instances\. For more information, see [Connect to your Linux instance](AccessingInstances.md)\.
1. From the terminal window for each instance, run the df \-T command to verify that the EFS file system is mounted\.
```
$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/xvda1 ext4 8123812 1949800 6073764 25% /
devtmpfs devtmpfs 4078468 56 4078412 1% /dev
tmpfs tmpfs 4089312 0 4089312 0% /dev/shm
efs-dns nfs4 9007199254740992 0 9007199254740992 0% /mnt/efs
```
Note that the name of the file system, shown in the example output as *efs\-dns*, has the following form:
```
file-system-id.efs.aws-region.amazonaws.com:/
```
1. \(Optional\) Create a file in the file system from one instance, and then verify that you can view the file from the other instance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
583621254380-1 | 1. \(Optional\) Create a file in the file system from one instance, and then verify that you can view the file from the other instance\.
1. From the first instance, run the following command to create the file:
```
$ sudo touch /mnt/efs/test-file.txt
```
1. From the second instance, run the following command to view the file:
```
$ ls /mnt/efs
test-file.txt
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
8862f4acbf61-0 | When you are finished with this tutorial, you can terminate the instances and delete the file system\.
**To terminate the instances**
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 instances to terminate\.
1. Choose **Actions**, **Instance State**, **Terminate**\.
1. Choose **Yes, Terminate** when prompted for confirmation\.
**To delete the file system**
1. Open the Amazon Elastic File System console at [https://console\.aws\.amazon\.com/efs/](https://console.aws.amazon.com/efs/)\.
1. Select the file system to delete\.
1. Choose **Actions**, **Delete file system**\.
1. When prompted for confirmation, type the ID of the file system and choose **Delete File System**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/AmazonEFS.md |
25ffbf909763-0 | With Amazon EBS Elastic Volumes, you can increase the volume size, change the volume type, or adjust the performance of your EBS volumes\. If your instance supports Elastic Volumes, you can do so without detaching the volume or restarting the instance\. This enables you to continue using your application while the changes take effect\.
There is no charge to modify the configuration of a volume\. You are charged for the new volume configuration after volume modification starts\. For more information, see the [Amazon EBS Pricing](http://aws.amazon.com/ebs/pricing) page\.
**Topics**
+ [Requirements when modifying volumes](modify-volume-requirements.md)
+ [Requesting modifications to your EBS Volumes](requesting-ebs-volume-modifications.md)
+ [Monitoring the progress of volume modifications](monitoring-volume-modifications.md)
+ [Extending a Linux file system after resizing a volume](recognize-expanded-volume-linux.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-modify-volume.md |
d2ed048d824f-0 | AWS can schedule events for your instances, such as a reboot, stop/start, or retirement\. These events do not occur frequently\. If one of your instances will be affected by a scheduled event, AWS sends an email to the email address that's associated with your AWS account prior to the scheduled event\. The email provides details about the event, including the start and end date\. Depending on the event, you might be able to take action to control the timing of the event\.
Scheduled events are managed by AWS; you cannot schedule events for your instances\. You can view the events scheduled by AWS, customize scheduled event notifications to include or remove tags from the email notification, perform actions when an instance is scheduled to reboot, retire, or stop\.
To update the contact information for your account so that you can be sure to be notified about scheduled events, go to the [Account Settings](https://console.aws.amazon.com/billing/home?#/account) page\.
**Topics**
+ [Types of scheduled events](#types-of-scheduled-events)
+ [Viewing scheduled events](#viewing_scheduled_events)
+ [Customizing scheduled event notifications](#customizing_scheduled_event_notifications)
+ [Working with instances scheduled to stop or retire](#schedevents_actions_retire)
+ [Working with instances scheduled for reboot](#schedevents_actions_reboot)
+ [Working with instances scheduled for maintenance](#schedevents_actions_maintenance)
+ [Rescheduling a scheduled event](#reschedule-event) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
82b8a13b0ba8-0 | Amazon EC2 can create the following types of events for your instances, where the event occurs at a scheduled time:
+ **Instance stop**: At the scheduled time, the instance is stopped\. When you start it again, it's migrated to a new host\. Applies only to instances backed by Amazon EBS\.
+ **Instance retirement**: At the scheduled time, the instance is stopped if it is backed by Amazon EBS, or terminated if it is backed by instance store\.
+ **Instance reboot**: At the scheduled time, the instance is rebooted\.
+ **System reboot**: At the scheduled time, the host for the instance is rebooted\.
+ **System maintenance**: At the scheduled time, the instance might be temporarily affected by network maintenance or power maintenance\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
3a20c5e9b2e0-0 | In addition to receiving notification of scheduled events in email, you can check for scheduled events using one of the following methods\.
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
4e464afa8517-0 | **To view scheduled events for your instances using the console**
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. You can view scheduled events in the following screens:
+ In the navigation pane, choose **Events**\. Any resources with an associated event are displayed\. You can filter by **Resource ID**, **Resource type**, **Availability zone**, **Event status**, or **Event type**\.
![\[Viewing events using the Events page.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/events-instance-scheduled-stop.png)
+ Alternatively, in the navigation pane, choose **EC2 Dashboard**\. Any resources with an associated event are displayed under **Scheduled events**\.
![\[Viewing events using the dashboard.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/dashboard-scheduled-events.png)
+ Some events are also shown for affected resources\. For example, in the navigation pane, choose **Instances** and select an instance\. If the instance has an associated instance stop or instance retirement event, it is displayed in the lower pane\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
4e464afa8517-1 | ![\[Viewing events in the instance details.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/event-instance-retirement.png)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
824d8ca0820e-0 | **To view scheduled events for your instances using the console**
1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\.
1. You can view scheduled events in the following screens:
+ In the navigation pane, choose **Events**\. Any resources with an associated event are displayed\. You can filter by resource type, or by specific event types\. You can select the resource to view details\.
![\[Viewing events using the Events page.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/events-instance-stop.png)
+ Alternatively, in the navigation pane, choose **EC2 Dashboard**\. Any resources with an associated event are displayed under **Scheduled Events**\.
![\[Viewing events using the dashboard.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/dashboard-scheduled-events-old.png)
+ Some events are also shown for affected resources\. For example, in the navigation pane, choose **Instances** and select an instance\. If the instance has an associated instance stop or instance retirement event, it is displayed in the lower pane\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
824d8ca0820e-1 | ![\[Viewing events in the instance details.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/event-instance-retirement-old.png)
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
e667d13479e1-0 | **To view scheduled events for your instances using the AWS CLI**
Use the [describe\-instance\-status](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instance-status.html) command\.
```
aws ec2 describe-instance-status \
--instance-id i-1234567890abcdef0 \
--query "InstanceStatuses[].Events"
```
The following example output shows a reboot event\.
```
[
"Events": [
{
"InstanceEventId": "instance-event-0d59937288b749b32",
"Code": "system-reboot",
"Description": "The instance is scheduled for a reboot",
"NotAfter": "2019-03-15T22:00:00.000Z",
"NotBefore": "2019-03-14T20:00:00.000Z",
"NotBeforeDeadline": "2019-04-05T11:00:00.000Z"
}
]
]
```
The following example output shows an instance retirement event\.
```
[
"Events": [
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
e667d13479e1-1 | The following example output shows an instance retirement event\.
```
[
"Events": [
{
"InstanceEventId": "instance-event-0e439355b779n26",
"Code": "instance-stop",
"Description": "The instance is running on degraded hardware",
"NotBefore": "2015-05-23T00:00:00.000Z"
}
]
]
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
8130fce91185-0 | **To view scheduled events for your instances using the AWS Tools for Windows PowerShell**
Use the following [Get\-EC2InstanceStatus](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2InstanceStatus.html) command\.
```
PS C:\> (Get-EC2InstanceStatus -InstanceId i-1234567890abcdef0).Events
```
The following example output shows an instance retirement event\.
```
Code : instance-stop
Description : The instance is running on degraded hardware
NotBefore : 5/23/2015 12:00:00 AM
```
------ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
dfea2af13ebc-0 | **To view scheduled events for your instances using instance metadata**
You can retrieve information about active maintenance events for your instances from the [instance metadata](ec2-instance-metadata.md) using Instance Metadata Service Version 2 or Instance Metadata Service Version 1\.
IMDSv2
```
[ec2-user ~]$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" –v http://169.254.169.254/latest/meta-data/events/maintenance/scheduled
```
IMDSv1
```
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/events/maintenance/scheduled
```
The following is example output with information about a scheduled system reboot event, in JSON format\.
```
[
{
"NotBefore" : "21 Jan 2019 09:00:43 GMT",
"Code" : "system-reboot",
"Description" : "scheduled reboot",
"EventId" : "instance-event-0d59937288b749b32",
"NotAfter" : "21 Jan 2019 09:17:23 GMT", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/monitoring-instances-status-check_sched.md |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.