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?

已提問 4 年前檢視次數 745 次
1 個回答
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.

已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南