Before you set AWS CLI configuration credentials to interact with your AWS services via command line, it is important that you have AWS CLI 2 installed on your device.
Follow this link - https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html to install CLI on your Windows/Mac/Linux/Ubuntu device.
Steps to setup AWS CLI Configure on Mac (macOS)/Linux/Ubuntu:
- Open Terminal App,
- Type command: aws configure
- Provide the AWS Access Key ID
- Provide the AWS Secret Access Key
- Provide the Default region name
- Provide the Default output format
% aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]:
Default output format [None]:
Steps to setup AWS CLI Configure on Windows:
- Open Command Prompt (or use Git Bash, Powershell or Bash for Windows),
- Type command: aws configure
- Provide the AWS Access Key ID
- Provide the AWS Secret Access Key
- Provide the Default region name
- Provide the Default output format
List of AWS Regions:
You can set the default region code from the below available AWS Regions as of August 2022.
Region Name | Region Code |
---|---|
US East (Ohio) | us-east-2 |
US East (N. Virginia) | us-east-1 |
US West (N. California) | us-west-1 |
US West (Oregon) | us-west-2 |
Africa (Cape Town) | af-south-1 |
Asia Pacific (Hong Kong) | ap-east-1 |
Asia Pacific (Jakarta) | ap-southeast-3 |
Asia Pacific (Mumbai) | ap-south-1 |
Asia Pacific (Osaka) | ap-northeast-3 |
Asia Pacific (Seoul) | ap-northeast-2 |
Asia Pacific (Singapore) | ap-southeast-1 |
Asia Pacific (Sydney) | ap-southeast-2 |
Asia Pacific (Tokyo) | ap-northeast-1 |
Canada (Central) | ca-central-1 |
China (Beijing) | cn-north-1 |
China (Ningxia) | cn-northwest-1 |
Europe (Frankfurt) | eu-central-1 |
Europe (Ireland) | eu-west-1 |
Europe (London) | eu-west-2 |
Europe (Milan) | eu-south-1 |
Europe (Paris) | eu-west-3 |
Europe (Stockholm) | eu-north-1 |
Middle East (Bahrain) | me-south-1 |
South America (São Paulo) | sa-east-1 |
List of Output formats for AWS CLI Configuration:
1 - json
2 - yaml
3 - yaml-stream
4 - text
5 - table
How to re-configure AWS CLI configuration
If you want to change any of the credentials or configurations at any time, you can do that by executing the same aws configure command again, pressing enter with no text to keep the previous values and typing in the text where you want to change it.
% aws configure
AWS Access Key ID [****************AAPX]: ASLJFKSFYWPQOUCASVSH12
AWS Secret Access Key [****************wrgR]:
Default region name [us-east-1]: us-east-2
Default output format [table]: json

More Posts related to AWS,
- Create S3 bucket and upload files using AWS Toolkit for Visual Studio Code
- Get the total size and number of objects of a AWS S3 bucket and folders
- Create an S3 bucket in a specific AWS region using CLI Command
- [Solution] AWS Java SDK S3 AmazonS3Exception InvalidAccessKeyId
- Fix AWS CLI 2 SignatureDoesNotMatch Error - Signature we calculated does not match
- 573 List of reserved keywords in AWS DynamoDB
- Quick way to setup AWS DynamoDB locally on macOS
- [Solution] com.amazonaws.dynamodb.v20120810 MissingAuthenticationToken Key Id or X.509 certificate
- Quick way to install AWS CLI for macOS Terminal
- Setting and Updating AWS CLI Configuration
- AWS S3 CLI BucketAlreadyExists when calling CreateBucket Error make_bucket failed
- How to install AWS Toolkit for Visual Studio Code
- Create S3 bucket using AWS CLI Command mb
- Fix: zsh: command not found: aws (Mac/macOS)
- How to install AWS CLI on Ubuntu
- Fix: Amazon Linux bash: sudo: command not found
- How to Setup AWS Credentials using Visual Studio Code
- AW3 CLI command to get list of all region names
- Most Essencial AWS CLI 2 S3 ls Command Options
- Install AWS CLI using Brew Command
More Posts:
- How to Rename a Git Local Branch Using the --move Option - Git
- java.lang.ClassNotFoundException android.support.v7.widget.Toolbar [Fix] - Android
- How to open CMD for current file/folder location in Notepad++ - NotepadPlusPlus
- How to install iTerm2 Mac Terminal Alternative - MacOS
- 10 Must Know CSS Border Styles with Examples - CSS
- The Zsh Shell - Mac Tutorial - MacOS
- Android : Remove ListView Separator/divider programmatically or using xml property - Android
- 10 Beginners Commands for macOS Terminal Usage - MacOS