I'm trying to download ECR images on my EC2 instance without having to provide a credentials file. So I created a role with the policy
AmazonEC2ContainerRegistryReadOnly and attached to my running instance. However, when I run
aws ecr describe-repositories --region us-east-2, I get the following error:
Unable to locate credentials. You can configure credentials by running "aws configure".
I'm not sure if attaching the role to the instance is sufficient, but I already tried to restart the instance and it still doesn't work.
Here's some screenshots from the AWS Console that may help find the problem: