0

I have a Windows EC2 instance with a role assigned. When I want to do some queries through awscli I get the error message:

"Unable to locate credentials."

But the role is obviously correctly attached:
http://169.254.169.254/latest/meta-data/iam/security-credentials/xxx-API-role

{
  "Code" : "Success",  
  "LastUpdated" : "2018-06-08T11:03:39Z",  
  "Type" : "AWS-HMAC",  
  "AccessKeyId" : "xxx",  
  "SecretAccessKey" : "xxx",  
  "Token" : "xxx",  
  "Expiration" : "2018-06-08T17:34:08Z"  
}

Any ideas why it is not working? This is already the third instance it is not work with.

Thanks!!

  • 1
    Possible duplicate of [AWS CLI in Windows EC2 cannot use role to access S3](https://stackoverflow.com/questions/44354685/aws-cli-in-windows-ec2-cannot-use-role-to-access-s3) – vahdet Jun 08 '18 at 11:42
  • 2
    @ArthurCantarela the 169.254.169.254 link is for the metadata service running on the EC2 instance. It's not reachable from outside the instance. The OP provided it, and its output, as evidence that the metadata service was running and serving up metadata (including IAM metadata). – jarmod Jun 08 '18 at 12:05
  • What does `aws configure list` show? – Brandon Miller Jun 08 '18 at 13:27
  • Output from aws configure list: Name Value Type Location ---- ----- ---- -------- profile None None access_key None None secret_key None None region us-east-1 config-file ~/.aws/config – Hero of craziness Jun 11 '18 at 11:16
  • @vahdet: This is already the third instance I'm trying. The solution you referring had no other solution but basically start from scratch... – Hero of craziness Jun 11 '18 at 11:24

0 Answers0