{"action":"created","issue":{"url":"https://api.github.com/repos/brendanhay/amazonka/issues/271","repository_url":"https://api.github.com/repos/brendanhay/amazonka","labels_url":"https://api.github.com/repos/brendanhay/amazonka/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/brendanhay/amazonka/issues/271/comments","events_url":"https://api.github.com/repos/brendanhay/amazonka/issues/271/events","html_url":"https://github.com/brendanhay/amazonka/issues/271","id":132917298,"number":271,"title":"EC2 credentials discovery fails (instance-data host gone?)","user":{"login":"screamish","id":328113,"avatar_url":"https://avatars.githubusercontent.com/u/328113?v=3","gravatar_id":"","url":"https://api.github.com/users/screamish","html_url":"https://github.com/screamish","followers_url":"https://api.github.com/users/screamish/followers","following_url":"https://api.github.com/users/screamish/following{/other_user}","gists_url":"https://api.github.com/users/screamish/gists{/gist_id}","starred_url":"https://api.github.com/users/screamish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/screamish/subscriptions","organizations_url":"https://api.github.com/users/screamish/orgs","repos_url":"https://api.github.com/users/screamish/repos","events_url":"https://api.github.com/users/screamish/events{/privacy}","received_events_url":"https://api.github.com/users/screamish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-11T08:39:08Z","updated_at":"2016-02-12T07:05:21Z","closed_at":null,"body":"I'm trying to use Discover for credentials from on an AWS EC2 instance and it's throwing this exception:\r\n\r\n```\"MissingFileError \\\"/root/.aws/credentials\\\"```\r\n\r\nHowever I've had a look at the code that's doing this and this function seems like Amazon might have broken a dependency.\r\n\r\nhttps://github.com/brendanhay/amazonka/blob/develop/amazonka/src/Network/AWS/EC2/Metadata.hs#L282\r\n\r\nWhen I try to run this via ssh on my EC2 instance I get the following:\r\n\r\n```\r\n$ curl http://instance-data/latest/meta-data/\r\ncurl: (6) Could not resolve host: instance-data\r\n```\r\n\r\nbut if I try the following it works:\r\n\r\n```\r\n$ curl http://169.254.169.254/latest/meta-data/\r\nami-id\r\nami-launch-index\r\n... snip ...\r\n```\r\n\r\nI couldn't find anything on AWS's docs about them removing that hostname. What do you think?"},"comment":{"url":"https://api.github.com/repos/brendanhay/amazonka/issues/comments/183205793","html_url":"https://github.com/brendanhay/amazonka/issues/271#issuecomment-183205793","issue_url":"https://api.github.com/repos/brendanhay/amazonka/issues/271","id":183205793,"user":{"login":"brendanhay","id":4493,"avatar_url":"https://avatars.githubusercontent.com/u/4493?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanhay","html_url":"https://github.com/brendanhay","followers_url":"https://api.github.com/users/brendanhay/followers","following_url":"https://api.github.com/users/brendanhay/following{/other_user}","gists_url":"https://api.github.com/users/brendanhay/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanhay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanhay/subscriptions","organizations_url":"https://api.github.com/users/brendanhay/orgs","repos_url":"https://api.github.com/users/brendanhay/repos","events_url":"https://api.github.com/users/brendanhay/events{/privacy}","received_events_url":"https://api.github.com/users/brendanhay/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T07:05:21Z","updated_at":"2016-02-12T07:05:21Z","body":"Because it relies on name resolution failure, instead of a timeout. If `169.254.169.254` is used - circumstances such as an overloaded host could result in the timeout being reached, and the instance not being detected as an EC2 host. I'm open to other suggestions, but I'd prefer to avoid the timeout if possible.\r\n\r\nIn the interim, if you're deploying to EC2 I'd suggest using `newEnv Sydney `(FromProfile \"default\")`, or whatever the default IAM profile on that host happens to be. This way the `isEC2` check will be skipped entirely."}}