AWS Instance Metadata
Luke Hebert
- One minute read - 142 wordsKnowing the IMDS link-local address saves you a trip to the documentation the next time you need to pull instance credentials or metadata from within an EC2 instance.
The address for the AWS EC2 Instance Metadata Service (IMDS) is a link-local IP address:
- IPv4:
169.254.169.254 - IPv6:
fd00:ec2::254(available on Nitro instances)
This address is accessible only from within the EC2 instance itself and is used to retrieve information about the instance, including its ID, AMI ID, security credentials, and more. When accessing this service, you typically append /latest/meta-data/ to the base URL to access the latest version of the metadata. For example:
http://169.254.169.254/latest/meta-data/IMDSv1 allowed direct access to the metadata endpoint. IMDSv2, which is now the default for new instances, requires a session token for authentication. You must obtain the token first and then include it in subsequent metadata requests.