🔗AWS meta-data

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 more information, see Instance Metadata Categories.

To view all the categories:

curl http://169.254.169.254/latest/meta-data/

To obtain the private IP address:

curl http://169.254.169.254/latest/meta-data/local-ipv4

To obtain the public IP address:

curl http://169.254.169.254/latest/meta-data/public-ipv4

To obtain the ssh public key:

curl http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key

To obtain the instance name:

curl http://169.254.169.254/latest/meta-data/instance-id

To obtain the availability-zone:

curl http://169.254.169.254/latest/meta-data/placement/availability-zone

🔗169.254/16

Link-local address In a computer network, a link-local address is a network address that is valid only for communications within the network segment (link) or the broadcast domain that the host is connected to. Link-local addresses are not guaranteed to be unique beyond a single network segment. Routers therefore do not forward packets with link-local addresses. For protocols that have only link-local addresses, such as Ethernet, hardware addresses assigned by manufacturers in networking elements are unique, consisting of a vendor identification and a serial identifier. Link-local addresses for IPv4 are defined in the address block 169.254.0.0/16 in CIDR notation. In IPv6, they are assigned the address block fe80::/64.[1]

See Dynamic Configuration of IPv4 Link-Local Addresses This document describes how a host may automatically configure an interface with an IPv4 address within the 169.254/16 prefix that is valid for communication with other devices connected to the same physical (or logical) link.