How to Retrieve EC2 Instance Meta Information

2020/4/11 min read
bookmark this

SSH into EC2 instance

To retrieve EC2 instance meta information, once SSH into EC2 instance type following command.

run with root privileges


sudo su

list all the metadata


curl http://169.254.169.254/latest/meta-data

Get EC2's hostname


curl http://169.254.169.254/latest/meta-data/local-hostname

Get EC2's user data


curl http://169.254.169.254/latest/user-data