Hey kid.. yeah you.. Are you tired of adding --profile <something>
to every CLI command? Stop doing that. You can use these easy aliases to set a "context" for your CLI to use until you clear it or change it really easily.
Make sure you have your ~/.aws/config
file configured properly for AWS SSO . Then go to your shell's "rc" file (eg. .bashrc
or .zshrc
) and add the following:
Now you can quickly hop back and forth between different accounts and not type out extra stuff.
Is it not working? Run that awsclear
alias you just made and get rid of that dumb .aws/credentials
file. It's almost 2024 and you don't need long lived keys anymore! (at least comment it all out while you test)
Note: Make sure you know what account you are in at all times by getting into the habit running the alias for that account when you aren't sure.
Top comments (0)