aws icon indicating copy to clipboard operation
aws copied to clipboard

Issue with loading credentials from instance metadata

Open astampoulis opened this issue 9 years ago • 2 comments

Ran into an issue with loading security credentials from EC2 instance metadata. The code in loadCredentialsFromInstanceMetadata expects the name of the IAM role to match the data in InstanceProfileArn. This is true when using the AWS CLI tool, but if instances and IAM roles are set up differently (e.g. through Terraform), that is not necessarily the case.

As far as I can tell looking at both amazonka and the Java SDK the expected way to get security credentials is to use the first role listed in /latest/meta-data/iam/security-credentials.

astampoulis avatar Feb 23 '16 22:02 astampoulis

The quickest way to get this is always a pull request:)

aristidb avatar Feb 24 '16 17:02 aristidb

I just hit this bug as well using Elastic Beanstalk environments which prevents using instance profiles. I'll try to investigate when I'm working with the instance metadata again.

creichert avatar Aug 04 '16 00:08 creichert