Provided by: amazon-ec2-utils_2.0.1-1_all
NAME
ec2-metadata - Retrieve instance metadata from within a running EC2 instance
SYNOPSIS
ec2-metadata [options]
DESCRIPTION
The ec2-metadata program is a utility to retrieve EC2 instance metadata from within a running EC2 instance. Instance metadata is data about your instance that you can use to configure or manage the running instance. Instance metadata is divided into categories, for example, host name, events, and security groups. You can also use instance metadata to access user data that you specified when launching your instance. For example, you can specify parameters for configuring your instance, or include a simple script. You can build generic AMIs and use user data to modify the configuration files supplied at launch time. For example, if you run web servers for various small businesses, they can all use the same generic AMI and retrieve their content from the Amazon S3 bucket that you specify in the user data at launch. To add a new customer at any time, create a bucket for the customer, add their content, and launch your AMI with the unique bucket name provided to your code in the user data. If you launch more than one instance at the same time, the user data is available to all instances in that reservation. Each instance that is part of the same reservation has a unique ami-launch- index number, allowing you to write code that controls what to do. For example, the first host might elect itself as an initial master node in a cluster.
OPTIONS
ec2-metadata will print all known metadata fields by default. The following options can be used to restrict the output to the selected fields. --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 kernel launched with this instance, if applicable. -z/--availability-zone The availability zone in which the instance launched. Same as placement -c/--product-codes Product codes associated with this instance. -p/--public-hostname The public hostname of the instance. -v/--public-ipv4 NATted public IP Address -u/--public-keys Public keys. Only available if supplied at instance launch time -r/--ramdisk-id The ID of the RAM disk launched with this instance, if applicable. -e/--reservation-id ID of the reservation. -s/--security-groups Names of the security groups the instance is launched in. Only available if supplied at instance launch time -d/--user-data User-supplied data.Only available if supplied at instance launch time. -h, --help Show summary of options.
SEE ALSO
1. Instance metadata and user data https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html 2. EC2 Instance Metadata Query Tool https://aws.amazon.com/code/ec2-instance-metadata-query-tool/ May 4 2020 EC2-METADATA(8)