AWS Profile Switcher in Go
Easily switch between AWS Profiles
min go 1.16
brew tap pjaudiomv/awsd
brew install awsd
make install
Add the following to your bash profile or zshrc then open new terminal or source that file
alias awsd="source _awsd"
Ex. echo 'alias awsd="source _awsd"' >> ~/.zshrc
awsd
For better visibility into what your shell is set to it can be helpful to configure your prompt to show the value of the env variable AWS_PROFILE
.
Here's a sample of my zsh prompt config using oh-my-zsh themes
# AWS info
local aws_info='$(aws_prof)'
function aws_prof {
local profile="${AWS_PROFILE:=}"
echo -n "%{$fg_bold[blue]%}aws:(%{$fg[cyan]%}${profile}%{$fg_bold[blue]%})%{$reset_color%} "
}
PROMPT='OTHER_PROMPT_STUFF $(aws_info)'
Inspired by https://github.com/johnnyopao/awsp