- assume_role
- role_detail
- remove_role
git clone https://github.com/weizard/assume-role.git ~/.oh-my-zsh/plugins/assume-role
plugins=(... assume-role)
add assume-role prompt
# zshrc
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(... aws_assume_role)
# powerlevel9k.zsh-theme
prompt_aws_assume_role() {
# local aws_profile="${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}"
local aws_profile="${ASSUMED_ROLE}"
if [[ -n "$aws_profile" ]]; then
"$1_prompt_segment" "$0" "$2" red white "$aws_profile" 'AWS_ICON'
fi
}
You can use 2fa to skip 2fa typing step. And if you have a concern with security, that you can chmod 700 for your 2fa.
If using 2fa please export 2fa name
export _2fa={2fa-name}