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/credentialsfile (on Unix-based systems) orC:\Users\USERNAME.aws\credentials(on Windows).Delete the
[default] section or any other named profile sectionthat 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! 😊
Top comments (0)