Quickly switch between AWS accounts on the command line
Uses aws-profile to generate AWS keys, assume role etc and spawns a new shell with these values populated.
pip install --upgrade awscli aws-profile
Git clone and add the aws-switch
script to your PATH
Todo: brew install
aws-switch [--help|-h] PROFILE
Where PROFILE is defined in your AWS config, for example:
[profile my-aws-account]
region = eu-west-1
# other options, including output, role_arn, mfa_serial etc.
# aws-switch my-aws-account
Switching to AWS profile my-aws-account...
# echo $AWS_SWITCH_PROFILE
my-aws-account
# aws sts get-caller-identity
[ Verify your user details, account ID etc. ]
The AWS_SWITCH_PROFILE
env var is set in the spawned shell for debugging purposes.
Originally developed by Adam Westbrook
Source, issues and questions available on Github
Please feel free to contribute, comments, fixes and improvements using the issue tracker linked above.