Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

Is there a straightforward way to access AWS instance metadata from within a Docker container?

For example, when trying to fetch credentials for an IAM role on an EC2 instance, this would work on the instance itself:

...but not from within a Docker container running on that EC2 instance.

1 Answer

0 votes
by (44.3k points)

This container can be used to access EC2 metadata directly:

[email protected]:/# curl


  "Code" : "Success",

  "LastUpdated" : "2019-07-14T15:04:12Z",

  "Type" : "AWS-HMAC",

  "AccessKeyId" : "accesskey",

  "SecretAccessKey" : "secretkey",

  "Token" : "mytoken",

  "Expiration" : "2019-04-14T21:08:29Z"


Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.6k users

Browse Categories