AWS ECR GetAuthorizationToken

Y. Eliash picture Y. Eliash · Jul 26, 2016 · Viewed 24.2k times · Source

I've tried to follow AWS instructions on setting ECR authorization to my user by giving the AmazonEC2ContainerRegistryFullAccess policy to my user.

However when I try to run on my PC the aws ecr get-login I get an error that I don't have permission.

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

What have I done wrong ?

Answer

fegoulart picture fegoulart · Sep 25, 2016

You must attach a policy to your IAM role.

I attached AmazonEC2ContainerRegistryFullAccess and it worked.