Using aws named profiles allow export using a bash function:
# Allow user to set aws profile in env
# requires aws and jq
# assume working role
awr() {
if [ -x "$(command -v jq)" ] && [ -x "$(command -v aws)" ]; then
export AWS_PROFILE=$1
echo -n "Assumed working role: "
aws sts get-caller-identity | jq .Arn
fi
}
then assuming you have a user-1 named profile in your ~/.aws/config file, export that user into the environment with:
awr user-1
Function then calls aws sts get-caller-identity to confirm what aws users is loaded.