- EN
- FR
You can get information about the configuration of instance by accessing metadata and user data from within the instance itself.
This action enables you to access information that would otherwise be inaccessible inside the instance.
You can also get this information from outside the instance using Cockpit, AWS CLI, or the API. For more information, see Getting Information About Your Instances.
Accessing Metadata of an Instance
Before you begin: Access the instance whose metadata you want to access. For more information, see Accessing Your Instances. |
To access the metadata of an instance, type the following command in a terminal of the instance, where CATEGORY is any of the category or category/subcategory available:
Request sample$ curl http://169.254.169.254/latest/meta-data/CATEGORY
You can also type the address
http://169.254.169.254/latest/meta-data/CATEGORY
in a web browser.CATEGORY Description ami-id
The ID of the OUTSCALE machine image (OMI) used to launch the instance. ami-launch-index
The launch index of the instance. For more information, see About Instances > General Information About Instances. block-device-mapping/
This category contains the following subcategories:
ami
: The device name of the root device of the instance.-
ebsN
: The device name of any additional volume attached to the instance, whereN
is an index starting from 1. root
: Same asami
.
hostname
The primary private DNS of the instance. instance-id
The ID of the instance. instance-type
The type of instance. local-hostname
Same as hostname
.local-ipv4
The primary private IP address of the instance. mac
The primary Media Access Control (MAC) address of the instance. network/interfaces/macs/
A list of MAC addresses associated with the instance. network/interfaces/macs/MAC_ADDRESS/
This category contains the following subcategories, where
MAC_ADDRESS
is any MAC address associated with the instance:device-number
: The number of the ethernet device for the network interface.gateway-ipv4
: The private IP address for the gateway.interface-id
: The ID of the network interface.ipv4-associations/PUBLIC_IP
: The private IP address associated with thePUBLIC_IP
address of the network interface.local-hostname
: The private DNS for the network interface.local-ip4s
: The private IP address for the network interface.mac
: The MAC address for the network interface.owner-id
: The account ID of the owner of the network interface.public-hostname
: The public DNS, if any, for the network interface.public-ipv4s
: The public IP address (or External IP, if any) for the network interface.security-group-ids
: A list of security group IDs for the network interface.security-groups
: A list of security group names for the network interface.subnet-id
: The ID of the subnet for the network interface.subnet-ipv4-cidr-block
: In a VPC, a range of IP addresses for the subnet, in CIDR notation.vpc-id
: In a VPC, the ID of the VPC for the network interface.
placement
/This category contains the following subcategories:
availability-zone
: The Availability Zone where the instance is.server
: The server where the instance is.cluster
: The cluster where the instance is.
public-hostname
The public DNS of the instance. public-keys/0/openssh-key
The public part of the keypair for the instance. For more information, see About Keypairs. reservation-id
The ID of the reservation the instance is associated with. security-groups
A list of security group names for the instance. For more information, see About Security Groups. tags/
A list of tags associated with the instance. For more information, see About Tags. tags/KEY_NAME
The tag Value corresponding to the
KEY_NAME
tag Key.The requested metadata of the instance appears.
Accessing User Data of an Instance
Before you begin: Access the instance whose user data you want to access. For more information, see Accessing Your Instances. |
To access the user data of an instance, type the following command in a terminal of the instance:
Request sample$ curl http://169.254.169.254/latest/user-data
You can also type the address
http://169.254.169.254/latest/user-data
in a web browser.The user data of the instance appears.
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.