AWS Instance Identity Documents
Instance Metadata Service
Instance metadata is the information provided by AWS about your EC2 instances, including details like Host Name, Public IP, and more. This information can be accessed through the Metadata Service available at 169.254.169.254
. This address is a link-local address that can only be accessed from within the EC2 instance. For example, you can retrieve the current Public IP using the following API:
curl http://169.254.169.254/latest/meta-data/public-ipv4