Find the instance id of an AWS EC2 instance within that EC2 machine
Briefly

Instance metadata is divided into categories, there are multiple ways to get the instance id and other user data and meta data of the AWS EC2 instance within that EC2 instance.
EC2 Instance Metadata Query Tool Download the tool from http://s3.amazonaws.com/ec2metadata/ec2-metadata Make the file executable and try ec2-metadata - help for help ec2-metadata options Options: - all Show all metadata information for this host (also default). -a/ - ami-id The AMI ID used to launch this instance -l/ - ami-launch-index The index of this instance in the reservation (per AMI). -m/ - ami-manifest-path The manifest path of the AMI with which the instance was launched. -n/ - ancestor-ami-ids The AMI IDs of any instances that were rebundled to create this AMI. -b/ - block-device-mapping Defines native device names to use when exposing virtual devices. -i/ - instance-id The ID of this instance -t/ - instance-type The type of instance to launch. For more information, see Instance Types. -h/ - local-hostname The local hostname of the instance. -o/ - local-ipv4 Public IP address if launched with direct addressing; private IP address if launched with public addressing. -k/ - kernel-id The ID of the
Read at Medium
[
add
]
[
|
|
]