A simple command line tool to switch between AWS SSO profiles.
Type aws-profile and hit Tab to see a list of available profiles.
$ aws-profile user
user1 (444455556666, readOnly, us-east-1) user2 (999988887777, powerUser, eu-west-2)Clone or download and unpack the repository. Then run the script according to your shell.
-
Fish shell:
fish/install.fish
For more information about configuring AWS in your shell, see Configuration and credential file settings in the AWS CLI in the AWS documentation.
This tool expects the config file at ~/.aws/config by default (can be set with the AWS_CONFIG_FILE environment
variable). Here is an example of a config file based on the AWS docs.
[default]
sso_session = my-sso
sso_account_id = 111122223333
sso_role_name = readOnly
region = us-west-2
output = text
[profile user1]
sso_session = my-sso
sso_account_id = 444455556666
sso_role_name = readOnly
region = us-east-1
output = json
[profile user2]
sso_session = my-sso
sso_account_id = 999988887777
sso_role_name = powerUser
region = eu-west-2
output = json
[sso-session my-sso]
sso_region = us-east-1
sso_start_url = https://my-sso-portal.awsapps.com/start
sso_registration_scopes = sso:account:access