Retrieving EC2 instance information form the instance itself

Amazon allowing an instance to retrieve information about itself from an internal public API server without providing AWS API credentials

The information is available on a Web Service that returns text/plain data

API URL: http://169.254.169.254/latest/meta-data/

Available information:

amiid
ami-launch-index
ami-manifest-path
block-device-mapping/
hostname
instance-action
instance-id
instance-type
kernel-id
local-hostname
local-ipv4
mac
network/
placement/
public-hostname
public-ipv4
public-keys/
reservation-id
security-groups

Example Request:

GET http://169.254.169.254/latest/meta-data/hostname

Response:

ec2-67-202-51-223.compute-1.amazonaws.com

Author:

There is no additional info about this author.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


+ 5 = seven

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>