Simple CLI tool that allows you to quickly toggle between AWS CLI profiles. It works by replacing the values of default
profile with the profile you select.
npm i -g aws-credential-switcher
NOTE: This tool updates your local
~/.aws/credentials
and~/.aws/config
files. Though we create a backup, it's recommended you create manual backups first.
aws-switch
or
aws-switch --credentialFile {fileLocation} --configFile {fileLocation}
Since this tool also updates the AWS config file, it's recommended you add a config option for each profile, even if they're duplicates.
[personal]
aws_access_key_id=abcedf
aws_secret_access_key=abcedf
[work]
aws_access_key_id=abcedf
aws_secret_access_key=abcedf
[profile personal]
region=us-west-2
output=json
[profile work]
region=us-east-1
output=json