AWSのApp Runnerを使用する際、DockerのimageをAmazon ECRへプッシュする必要があった。
aws-cliのversionは2.0.30
Amazon ECRのpublicリポジトリへdocker imageをpushしようとした際、下記コマンドを打った時に出たエラーaws ecr-public get-login-password --region <region> | docker login --username AWS --password-stdin public.ecr.aws/<id>
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument command: Invalid choice, valid choices are:
accessanalyzer | acm
acm-pca | alexaforbusiness
amplify | apigateway
apigatewaymanagementapi | apigatewayv2
appconfig | application-autoscaling
application-insights | appmesh
appstream | appsync
athena | autoscaling
autoscaling-plans | backup
batch | budgets
ce | chime
cloud9 | clouddirectory
cloudformation | cloudfront
cloudhsm | cloudhsmv2
cloudsearch | cloudsearchdomain
cloudtrail | cloudwatch
codeartifact | codebuild
codecommit | codeguru-reviewer
codeguruprofiler | codepipeline
codestar | codestar-connections
codestar-notifications | cognito-identity
cognito-idp | cognito-sync
comprehend | comprehendmedical
compute-optimizer | connect
connectparticipant | cur
dataexchange | datapipeline
datasync | dax
detective | devicefarm
directconnect | discovery
dlm | dms
docdb | ds
dynamodb | dynamodbstreams
ebs | ec2
ec2-instance-connect | ecr
ecs | efs
eks | elastic-inference
elasticache | elasticbeanstalk
elastictranscoder | elb
elbv2 | emr
es | events
firehose | fms
..........(略).........
workdocs | worklink
workmail | workmailmessageflow
workspaces | xray
s3api | s3
ddb | configure
deploy | configservice
opsworks-cm | history
cli-dev | help
Error: Cannot perform an interactive login from a non TTY device
aws cliが最新でなかったのが原因
インストールした時と同じ方法で、インストールしなおしたら解決した。
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
最新版は2.4.9(2022/01時点)
Amazon ECRはリポジトリがprivateとpublicとで、打つコマンドが異なるので注意