How To Find the AWS Region and Availability Zone Via the CLI

Author: , June 30th, 2015

/opt/aws/bin/ec2-metadata | grep placement

How To Find The Instance ID In AWS EC2

Author: , January 8th, 2011

UPDATE: # yum install ec2-utils # rpm -ql ec2-utils /etc/udev/rules.d/51-ec2-hvm-devices.rules /opt/aws/bin/ec2-metadata /sbin/ec2udev # ec2-metadata -i | awk ‘{print $2}’ Just wrote a script for BudgetTravel.com and needed to determine the Instance ID. Here is how: $ wget http://s3.amazonaws.com/ec2metadata/ec2-metadata $ chmod u+x ec2-metadata $ ./ec2-metadata -i # ec2-metadata -i | awk ‘{print $2}’ > /etc/instanceid Link […]