Work with multiple AWS sessions and get tired of switching accounts manually? Use the following commands to automatically switch between AWS accounts!
aws configure --profile user2
To use from your command prompt, here’s an example:
aws ec2 describe-instances --profile user2
I needed this functionality since I work with multiple AWS sessions. The full documentation can be found on the links below.