How it works
The metadata service runs on a link-local IP address (169.254.169.254) that is only reachable from within the server itself. Before querying metadata, you request a short-lived session token. You can then retrieve all metadata as a single JSON object or query individual fields by path.
Quick start
1
Get a session token
Request a session token with a TTL (time-to-live) in seconds. The token is returned in the response body.
2
Retrieve all metadata as JSON
Use the token to fetch the full metadata object:
3
Query individual fields
You can also retrieve specific fields by path:
The metadata service is only accessible from within the server. It cannot be reached from the public internet or from other servers.
Available fields
Common use cases
- Network configuration — read interface details and IPs to configure networking at boot
- Dynamic inventory — register the server in Ansible, Consul, or other inventory systems using its own metadata
- Cloud-init scripts — combine with user data to build dynamic configuration scripts that adapt to the server’s environment
- Application configuration — inject region, hostname, or tags into your application’s runtime config