I’m a big fan of AWS’s SDK’s and API tools because they’re so comprehensive and easy to use, in general, but I sometimes forget that there’s another good, even simpler API for getting data from some AWS resources… the magical http://169.254.169.254/ http endpoint!

This endpoint provides read-only metadata about resources once you have access, and doesn’t require additional authentication. This is very handy, for instance, when a client gives me SSH or RDP access to an EC2 instance and I need to know its size, network info, or in this case what Availability Zone it is in:

in powershell:

Invoke-WebRequest http://169.254.169.254/latest/meta-data/placement/availability-zone