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,
- Get the total size and number of objects of a AWS S3 bucket and folders
- How to Create AWS SNS Topic using AWS CLI
- Fix: Amazon Linux bash: sudo: command not found
- [Solution] AWS Java SDK S3 AmazonS3Exception InvalidAccessKeyId
- Create an AWS User using CLI2 Command at a specific Path
- Fix: Missing the following required SSO configuration values: sso_start_url, sso_region
- Fix: zsh: command not found: aws (Mac/macOS)
- Configure AWS Access ID and Secret Keys using CLI on Mac
- Quick way to setup AWS DynamoDB locally on macOS
- Most Essencial AWS CLI 2 S3 ls Command Options
- How to Check AWS SNS Permissions using CLI
- AWS CLI Change Default Output Format
- How to install AWS CLI on Ubuntu
- Quick way to install AWS CLI for macOS Terminal
- Install AWS CLI using Brew Command
- AWS CLI Command to Get a List of SNS Topics
- Get List of AWS SNS Topic Subscriptions using CLI
- How to Setup AWS Credentials using Visual Studio Code
- Installing AWS CLI Version 2 on macOS Sonoma using Terminal
- AW3 CLI command to get list of all region names
- AWS SNS CLI Command Publish Message Attributes
- Create an S3 bucket in a specific AWS region using CLI Command
- [Fix] zsh: command not found: awscli [Mac Terminal]
- Understanding AWS Calculator: DynamoDB on-demand capacity
- [Solution] com.amazonaws.dynamodb.v20120810 MissingAuthenticationToken Key Id or X.509 certificate
More Posts:
- Check if a Java Date String is Valid or Not (Java 8) - Java
- AlertDialog with single button example : Android - Android
- How to use SCP Command to Copy Directory - Linux
- Twitch chat down, error loading data, content unavailable, streaming problem - News
- Fix: type argument is not within bounds of type-variable T - Java
- How to add Newline to text in Android TextView - Android
- Fix - A JavaScript error occurred in the main process - Microsoft Teams - Teams
- How to lock cells in Microsoft Excel for Mac - Windows