(1.) After successfully configuring a second profile for the AWS CLI, I unsuccessfully tried to set the profile to user2 in my bash session with the following command:
... per the advice here: https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
(2.) The following command works:
aws s3 ls --profile user2
So I know that the AWS CLI and the user2 profile are both working on my computer.
(3.) However, when I subsequently (that is, after entering "export AWS_PROFILE=user2") try something like:
aws s3 ls
... AWS's response assumes that I want to query it as the default user (NOT user2)
(4.) So the only way I can use the user2 profile from the command line is by continuing to append "--profile user2" to every single command, which is tedious.
, as expected.