0
votes

Im am currently trying to login to the Amazon ECR using the following command aws ecr get-login --region eu-west-2 --no-include-email and am recieveing the following error;

An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::************:user/referral is not authorized to perform: ecr:GetAuthorizationToken on resource:

Here is what I have currently tried;

  • Assinging amazonec2containerregistryfullaccess to both user and group
  • 2FA disabled
  • I also tried to add a Statement within the premissions section of the repo that I had created within Amazon ECR

All the solutions above failed and I am still receieveing the same error, any help on this would be greatly appreciated !

1
Hey, have you tried checking that policy in docs.aws.amazon.com/IAM/latest/UserGuide/… ? I've found no useful use to add Statement permissions in ECR repos directly. Also you could check running that same using an admin account or yours from your local. Also it's always good to check in CloudTrail about API calls, maybe it gives you some more insights.marianogg9

1 Answers

0
votes

Changing access tokens in both ~/.aws/credentials and ~/.aws/config worked for me.

sudo vim ~/.aws/config
sudo vim ~/.aws/credentials