Instance identity documents for Amazon EC2 instances
Each instance that you launch has an instance identity document that provides information about the instance itself. You can use the instance identity document to validate the attributes of the instance.
The instance identity document is generated when the instance is stopped and started, restarted, or launched. The
instance identity document is exposed (in plaintext JSON format) through the Instance Metadata Service
(IMDS). The IPv4 address 169.254.169.254
is a link-local address and is
valid only from the instance. For more information, see Link-local address[fd00:ec2::254]
is a unique local address and is
valid only from the instance. For more information, see Unique local address
Note
The examples in this section use the IPv4 address of the IMDS:
169.254.169.254
. If you are retrieving instance metadata for EC2
instances over the IPv6 address, ensure that you enable and use the IPv6 address
instead: [fd00:ec2::254]
. The IPv6 address of the IMDS is
compatible with IMDSv2 commands. The IPv6 address is only accessible on Instances built on the Amazon
Nitro System and in an IPv6-supported subnet (dual stack or IPv6 only).
You can retrieve the instance identity document from a running instance at any time. The instance identity document includes the following information:
Data | Description |
---|---|
accountId |
The ID of the Amazon account that launched the instance. |
architecture |
The architecture of the AMI used to launch the instance (i386 | x86_64 | arm64). |
availabilityZone |
The Availability Zone in which the instance is running. |
billingProducts |
The billing products of the instance. |
devpayProductCodes |
Deprecated. |
imageId |
The ID of the AMI used to launch the instance. |
instanceId |
The ID of the instance. |
instanceType |
The instance type of the instance. |
kernelId |
The ID of the kernel associated with the instance, if applicable. |
marketplaceProductCodes |
The Amazon Web Services Marketplace product code of the AMI used to launch the instance. |
pendingTime |
The date and time that the instance was launched. |
privateIp |
The private IPv4 address of the instance. |
ramdiskId |
The ID of the RAM disk associated with the instance, if applicable. |
region |
The Region in which the instance is running. |
version |
The version of the instance identity document format. |