smartystreets/go-aws-auth — pull request #8 by drocamor (2014-02-19 14:55:06+00:00)
Title: Adding IAM Role Support

Hi!

This PR adds IAM role support. It tries to get credentials in this order:

1. Keys that are manually set
2. Environment variables
3. The first IAM role available

It handles getting new credentials when the old ones expire. It also checks to see if it is on an EC2 instance before doing some time consuming HTTP requests to try to get an IAM role credential.

There is certainly some work to do around getting this to handle multiple Roles. I feel it may seem a bit hacky, but I think it's ready for review. I have tested it locally, on an instance with an admin role, and on an instance without a role.

-Dave