Skip to content

How to get Meta-Data information from an AWS EC2 Instance

If you need to query meta-data information from your running EC2 instance, you can curl the following location:

curl http://169.254.169.254/latest/meta-data
Code language: Bash (bash)

This will provide a list of all information that can be retrieved.

Say you want to get the local IPv4 address, this can be done as follows:

curl http://169.254.169.254/latest/meta-data/local-ipv4
Code language: Bash (bash)

You can also get JSON blocks of information back, such as querying the IAM Info:

curl http://169.254.169.254/latest/meta-data/iam/info
Code language: Bash (bash)

See also  Actionscript2: Split string by line length with & without word-wrap
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x