aws ecr get-loginでポリシー不足でエラーが出力
記録としてメモしとく。
やりたかったこと
AWS-CLI使って Amazon ECRにログインしたい。
前提
私の環境
- Windows10 Pro
- AWS CLIインストール済
> aws --version
aws-cli/1.16.313 Python/3.7.2 Windows/10 botocore/1.13.49
事象
PS C:\Users\taketakekaho> aws ecr get-login --region ap-northeast-1 --profile <profile> --no-include-email
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::XXXXXXXXXXXX:user/<profile> is not authorized to perform: ecr:GetAuthorizationToken on resource: *
PS C:\Users\taketakekaho> aws ecr get-login --region ap-northeast-1 --profile <profile> --no-include-email
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::XXXXXXXXXXXX:user/<profile> is not authorized to perform: ecr:GetAuthorizationToken on resource: *
なんかアクセス権的なものがないようでエラーが出る。
対処
このAmazonEC2ContainerRegistryPowerUserというポリシーが足りなかったらしい。以下のようにアタッチした所解消しました。
というか…
情報探す中でたまたま読んだクラスメソッドさんの技術ブログ([アップデート]AWS CLI v2 で $ aws ecr get-login を使うときの注意点)で $ aws ecr get-login はv1でも非推奨 ということを初めて知った…気を付けよう。
参考
Author And Source
この問題について(aws ecr get-loginでポリシー不足でエラーが出力), 我々は、より多くの情報をここで見つけました https://qiita.com/taketakekaho/items/6b3ab23100e2731ce586著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .