aws-cli Unable to locate credentials at launch

0

Hi Folks,

I'm trying to run a userdata script to mount an EBS volume on my Batch instances during it's launch however no matter what I do the aws cli can't find the IAM Profile credentials. Running aws cli always returns "Unable to locate credentials. You can configure credentials by running "aws configure".

If I ssh into the instance I can curl the local metadata endpoint and confirm that the the profile were properly assigned.

I saw some old posts and blogs about this error but none of the solutions proposed seems to work. Some posts mentions that if the role is attached after the instance launch than aws cli won't see the credentials but I can't say if thats the case or not if instances managed by AWS Batch, nor do I found who should I setup my cloudformation template in order to make the credentials available for the userdata script.

Can someone advise me? Has anyone already faced this problem?

asked 5 years ago894 views
1 Answer
0

Ok, figure out the error finally. Given that AWS Batch seems to rely on a set of other APIS (namely ECS and EC2) I got a little confused withe multiples roles (and specifically the trust relationships required by each).

Also troubleshooting the issues were a little painful until I found the AWS Faq "My Job got stuck in runnable state". Only after reading this troubleshooting guide I could make sense about the role of each service.

Regards.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions