AWS Command Line Interface Installation
- Click here to view the troubleshooting content for this document
Create an Access Key
- Create an IAM User
- Navigate to
https://console.aws.amazon.com/iam/
- In the navigation pane, choose
Users
. - Select the name of the user you would like to generate an access key for
- Select the
Security credentials
tab. - Select
Create access key
from theAccess keys
section.
Install AWS CLI
Windows Operating System
- Execute the command below from an administrative PowerShell.
choco install awscli
Verify Installation
- Execute the command below to ensure that the AWS CLI has been installed
aws --version
- Execute the command below to ensure that the
.aws
directory has been createdcd ~/.aws
Configure AWS CLI
- Upon executing
aws configure
the AWS CLI prompts you for:- Access key ID
- Secret access key
- AWS Region
- Output format
- Sample output
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json
Validate AWS CLI Configuration
- Execute the command below to verify that the
~/.aws/credentials
file has been modified respectivelycat ~/.aws/credentials
Verify AWS CLI Configuration
- Execute the command below to verify that you are able to connect.
aws iam list-users
- Ensure the command output is not the text below
An error occurred (InvalidClientTokenId) when calling the ListUsers operation: The security token included in the request is invalid.
Fetch ECR Password
- Execute the command below to fetch the ecr login password
aws ecr get-login-password
- Execute the command below to log in
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin AMAZON_USER_ID.dkr.ecr.us-east-1.amazonaws.com