I’ve got a home account & a work account. I need to easily swap between the 2.
Add 2 sets of creds
~/.aws/credentials
[default] aws_access_key_id=AKIAIOSFODNN7EXAMPLE aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY [work] aws_access_key_id=AKIAI44QH8DHBEXAMPLE aws_secret_access_key=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY
Add 2 sets of region / outputs
~/.aws/config
[default] region=us-west-2 output=json [profile work] region=us-east-1 output=text
Then to use a profile:
export AWS_PROFILE=work
OR
aws ec2 describe-instances --profile work