Retrieve dynamic data - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Retrieve dynamic data

To retrieve dynamic data from within a running instance, use the following URI.

The examples in this section use the IPv4 address of the IMDS: 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 IMDSis compatible with IMDSv2 commands. The IPv6 address is only accessible on Instances built on the Nitro System.

This example shows how to retrieve the high-level instance identity categories.

[ec2-user ~]$ TOKEN=`curl -X PUT "" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \ && curl -H "X-aws-ec2-metadata-token: $TOKEN" -v rsa2048 pkcs7 document signature dsa2048
[ec2-user ~]$ curl rsa2048 pkcs7 document signature dsa2048

For more information about dynamic data and examples of how to retrieve it, see Instance identity documents.