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 current available version: latest.

The following table lists the categories of instance metadata

/latest/meta-data/#

Endpoint

Description

Example

ami-id

The CMI 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 names of the virtual devices associated with an EBS volume, if any are present. The N indicates the index of an attached EBS volume (such as ebs2 or ebs3). For example, if an instance have two attached volume, the endpoint block-device-mapping/ebs2 will return /dev/vdb.

/deb/vdb

instance-type

Instance type.

m1.small

instance-id

Instance ID.

i-XXXXXXXX

hostname

ID or private DNS of the instance.

i-XXXXXXXX

local-hostname

The local name of the instance. If the instance has more than one network interface, its name will be resolved to the IPv4 address of the first interface, eth0.

ip-XXX-XXX-XXX-XXX.vpc-XXXXXXXX.internal

local-ipv4

The private IPv4 address of the instance. If there are multiple network interfaces, it relates to the eth0 device.

XXX.XXX.XXX.XXX

public-hostname

The public DNS of the interface. 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.ngn.com.tr

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 group of instances, created by one RunInstances request.

r-XXXXXXXX

security-groups

The names of the security groups applied to the instance. After launch, you can only change security groups of instances running in a VPC.

sg-XXXXXXXX

mac

MAC address of instance’s primary interface.

XX:XX:XX:XX:XX:XX

/latest/meta-data/network/interfaces/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

The local name of the instance. If the instance has more than one network interface, its name will be resolved to the IPv4 address of the first interface, eth0.

ip-XXX-XXX-XXX-XXX.vpc-XXXXXXXX.internal

local-ipv4s

The private IPv4 address of the instance. If there are multiple network interfaces, it relates to the eth0 device.

XXX.XXX.XXX.XXX

mac

MAC address of instance’s primary interface.

XX:XX:XX:XX:XX:XX

public-hostname

The public DNS of the interface. 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.ngn.com.tr

public-ipv4s

EIP addresses (Elastic IP Addresses) associated with the instance. One instance can have several IPv4 addresses.

XXX.XXX.XXX.XXX

security-group-ids

The IDs of the security groups applied to the instance. After launch, you can only change security groups of instances running in a VPC.

sg-XXXXXXXX

security-groups

The names of the security groups applied to the instance. After launch, you can only change 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

The IPv4 address range in CIDR notation for a subnet

XXX.XXX.XXX.XXX/YY

vpc-id

The ID of the VPC, in which instance is launched.

vpc-XXXXXXXX

vpc-ipv4-cidr-block

The IPv4 address range in CIDR notation for a VPC

XXX.XXX.XXX.XXX/YY

vpc-ipv4-cidr-blocks

List of IPv4 address ranges in CIDR notation.

XXX.XXX.XXX.XXX/YY