Switch AWS CLI profiles

Work and personal accounts in one terminal without mixing them up.

SNP 097 #935 Filed aws cmd

Add profiles once:

shell
aws configure --profile work
aws configure --profile personal

They land in ~/.aws/credentials and ~/.aws/config. Use one per command:

shell
aws s3 ls --profile work

Or for the whole shell session:

shell
export AWS_PROFILE=work

Check who you are before you do anything destructive:

shell
aws sts get-caller-identity

For SSO accounts, aws configure sso sets up the profile and aws sso login --profile work refreshes the session.