If you are like us you likely have a half dozen AWS CLI profiles configured on your machine. Using AWS named profiles is a great help but, dang, wouldn't it be nice to be able to very quickly switch from one profile to another? And, my, oh my, wouldn't it be great if there was some kind of auto-complete feature to help you remember the names of your profiles??
Look no further (unless you are using Windows -- you need more help than I can provide)! awsprof is just the little script you need!
- Your AWS credentials are stored at
~/.aws/credentials - You are using a Linux shell that permits functions (such as Bash or Zsh)
completeis installed
- Copy
awsprof-completer.bashto your~/.aws/folder - Edit your
.bashrcor.zshrcand add the function from the.rcfile to it (at the end is likely fine). - Run
source ~/.bashrcorsource ~/.zshrcto update your current shell.
- Type:
awsprof {profile name}to switch profiles. - Type:
awsprof <TAB>to get a list of current profiles. - Type:
awsprof coop<TAB>to auto-completecoopdigityfor example ;)