Showing posts from February, 2019

Getting AWS EC2 instance id (instanceid) from within the ec2 instance

In general you can get a lot of instance metadata by accessing API on That includes instance id. On generic Linux system, you can get the ID either using curl: curl or wget: wget -q -O - If you instance is based on Amazon Linux or have cloud-utils installed you can also run: ec2-metadata -i for instance id. more documentation on metadata is a available here: Provided by: Forthscale systems, cloud experts