IMDS initiate session
Jump to navigation
Jump to search
- Initiate session (bash example)
TOKEN=`curl --request PUT "http://169.254.169.254/latest/api/token" --header "X-aws-ec2-metadata-token-ttl-seconds: 600"`
- Continue session with GET request but required token
curl --request GET "http://169.254.169.254/latest/metadata/ami-id" --header "X-aws-ec2-metadata-token: $TOKEN"
- This token expires after 10 minutes (600 seconds)
- IMDS distinguishes between v1 and v2 requests by presence of
See also
Advertising: