Skip to main content

Command Palette

Search for a command to run...

AWS CLI Basics: A Beginner’s Tutorial

Updated
•1 min read•View as Markdown
AWS CLI Basics: A Beginner’s Tutorial

Install AWS CLI

Download and Install it from the official AWS CLI installation guide.

Run aws configure

$ aws configure

aws configure --profile myprofile
AWS Access Key ID [None]: YOUR_ACCESS_KEY_ID
AWS Secret Access Key [None]: YOUR_SECRET_ACCESS_KEY
Default region name [None]: us-west-2
Default output format [None]: json

Verify Configuration

aws configure list

Configuration Files

AWS configure command stores your credentials & configuration settings in two files located in the ~/.aws directory:

  • ~/.aws/credentials: Stores your AWS access key ID and secret access.

  • key.~/.aws/config: Stores your default region and output format.

Remove Credentials from Configuration File

Manually remove the credentials from the configuration file

  • Open the ~/.aws/credentials file (on Unix-based systems) or C:\Users\USERNAME.aws\credentials (on Windows).

  • Delete the [default] section or any other named profile section that contains your credentials.

Unset Environment Variables

If you have set your AWS credentials using environment variables, you can unset them:

unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SESSION_TOKEN

Delete AWS CLI Cache

rm -rf ~/.aws/cli/cache

Feel free to share and spread the knowledge! 🌟😊 Enjoy Learning! 😊