amazon-web-servicescontainersaws-powershellaws-ecr

AWS Windows Powershell ECR Login


I am new to AWS and Docker. I am trying to setup AWS ECR and docker and trying to retrieve ECR Login using windows powershell. I am trying to use the command -

Invoke-Expression -Command (aws ecr get-login) which gives me the errorenter image description here

My problem is it is trying to use the ccuser on its own. I don't think I have configured it to use this user. I have created a separate user with AmazonEC2ContainerRegistryFullAccess. How do I configure this as the user for AWS Powershell to execute the command?


Solution

  • aws ecr get-login will simply use the creds that you've already setup for the AWS CLI. If you want to change the creds for the CLI, use aws configure to do the setup again, it will ask you for:

    AWS Access Key ID []: AWS Secret Access Key []: Default region name []: Default output format []:

    If you only want to use that user temporarily without reconfiguring your existing account, here are the docs for doing that.