Skip to content

Quickly switch between AWS accounts on the command line

License

Notifications You must be signed in to change notification settings

adamdodev/aws-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

aws-switch

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.

Prerequisites

aws-profile

pip install --upgrade awscli aws-profile

Install

Git clone and add the aws-switch script to your PATH

Todo: brew install

Usage

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.

Info

Originally developed by Adam Westbrook

Licence

Source, issues and questions available on Github

Please feel free to contribute, comments, fixes and improvements using the issue tracker linked above.

About

Quickly switch between AWS accounts on the command line

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages