lyft / metadataproxy

A proxy for AWS's metadata service that gives out scoped IAM credentials from STS
Other
456 stars 69 forks source link

Mock URI for determining availability-zone is incorrect #83

Closed salekseev closed 5 years ago

salekseev commented 5 years ago
# curl http://169.254.169.254/latest/meta-data/placement/availability-zone
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>

and

169.254.169.2 - - [01/Apr/2019:14:29:22 +0000] "GET /latest/meta-data/placement/availability-zone HTTP/1.1" 404 233 "-" "curl/7.58.0"
[2019-04-01 14:29:22 +0000] [12] [DEBUG] Closing connection.

Indeed code at https://github.com/lyft/metadataproxy/blob/1.6.0/metadataproxy/routes/mock.py#L364-L366 does not correspond documented endpoint https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html and should be /latest/meta-data/placement/availability-zone and not /latest/meta-data/availability-zone.

ryan-lane commented 5 years ago

Merged in and released at 1.7.0. Should show up in dockerhub/pypi soon. Thanks for the contribution!