Instance Metadata Categories

All metadata is returned as text (content type text/plain). A request for a specific metadata resource returns the appropriate value, or a 404 - Not Found HTTP error code if the resource is not available. A request for a general metadata resource (the URI ends with a /) returns a list of available resources, or a 404 - Not Found HTTP error code if there is no such resource. The latest version: latest.

The following table lists the categories of instance metadata

/latest/meta-data/
Endpoint Description Example
ami-id The AMI ID used to launch the instance. cmi-XXXXXXXX
ami-launch-index If you started more than one instance at the same time, this value indicates the order in which the instance was launched. The value of the first instance launched is 0. <index number>
block-device-mapping/ami The virtual device that contains the root/boot file system. /dev/<partition id>
block-device-mapping/root The virtual devices or partitions associated with the root devices, or partitions on the virtual device, where the root (/ or C:) file system is associated with the given instance. /dev/vda
block-device-mapping/ebs<N> The virtual devices associated with EBS volumes, if any are present. The N indicates the index of the EBS volume (such as ebs2 or ebs3). /deb/vdb
instance-type The type of instance. m1.small
instance-id The ID of this instance. i-XXXXXXXX
hostname ID or private DNS of the instance. i-XXXXXXXX
local-hostname Local name of the instance. If instance has more than one network interface, its name will resolve IPv4 addresses of the first interface eth0. i-XXXXXXXX.vpc-XXXXXXXX.internal
local-ipv4 The private IPv4 address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device. XXX.XXX.XXX.XXX
public-hostname The instance’s public DNS. If the instance is in a VPC, this category is only returned if the enableDnsHostnames attribute is set to true. c2-XXX-XXX-XXX-XXX.elastic.cloud.croc.ru
public-keys/<number> Public key. Only available if supplied at instance launch time. ssh-rsa AAAAB3N…
public-ipv4 The public IPv4 address. If an eip (Elastic IP) address is associated with the instance, the value returned is the eip address. XXX.XXX.XXX.XXX
placement/availability-zone The Availability Zone in which the instance launched. ru-msk-comp1p
reservation-id The ID of the reservation. r-XXXXXXXX
security-groups The names of the security groups applied to the instance. After launch, you can only changes the security groups of instances running in a VPC. sg-XXXXXXXX
mac MAC address of instance’s main interface. XX:XX:XX:XX:XX:XX
/latest/meta-data/network/macs/<interface_mac>/
Endpoint Description Example
device-number Number of the interface. <index number>
ipv4-associations/<public_ip> Private IPv4 address, to which assigned public IPv4 address. XXX.XXX.XXX.XXX
local-hostname Local name of the instance. If instance has more than one network interface, its name will resolve IPv4 addresses of the first interface eth0. i-XXXXXXXX.vpc-XXXXXXXX.internal
local-ipv4s The private IPv4 address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device. XXX.XXX.XXX.XXX
mac MAC address of instance’s main interface. XX:XX:XX:XX:XX:XX
public-hostname The instance’s public DNS. If the instance is in a VPC, this category is only returned if the enableDnsHostnames attribute is set to true. c2-XXX-XXX-XXX-XXX.elastic.cloud.croc.ru
public-ipv4s List of Elastic IP addresses associated with the instance. XXX.XXX.XXX.XXX
security-group-ids List of security groups ids associated with the instance. sg-XXXXXXXX
security-groups The names of the security groups applied to the instance. After launch, you can only changes the security groups of instances running in a VPC. security_group_name
subnet-id The ID of the subnet, in which instance is started. subnet-XXXXXXXX
subnet-ipv4-cidr-block IPv4 CIDR block assigned to subnet. XXX.XXX.XXX.XXX/YY
vpc-id VPC ID in which instance is started. vpc-XXXXXXXX
vpc-ipv4-cidr-block IPv4 CIDR block assigned to VPC. XXX.XXX.XXX.XXX/YY
vpc-ipv4-cidr-blocks List of IPv4 CIDR blocks. XXX.XXX.XXX.XXX/YY