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?

gefragt vor 4 Jahren745 Aufrufe
1 Antwort
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.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen