Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weizard/assume-role
A plugin for zsh.
https://github.com/weizard/assume-role
Last synced: about 2 months ago
JSON representation
A plugin for zsh.
- Host: GitHub
- URL: https://github.com/weizard/assume-role
- Owner: weizard
- Created: 2019-01-04T07:03:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-01-30T02:53:40.000Z (over 5 years ago)
- Last Synced: 2024-01-24T15:13:02.470Z (4 months ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-zsh-plugins - assume-role - ZSH plugin to allow you to assume AWS IAM roles easily. Includes completions. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - assume-role - ZSH plugin to allow you to assume AWS IAM roles easily. Includes completions. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - assume-role - ZSH plugin to allow you to assume AWS IAM roles easily. Includes completions. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - assume-role - ZSH plugin to allow you to assume AWS IAM roles easily. Includes completions. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - assume-role - ZSH plugin to allow you to assume AWS IAM roles easily. Includes completions. (Plugins / Zinit (née zplugin))
README
# assume_role plugin
## Method
- assume_role
- role_detail
- remove_role## Install
``` zsh
git clone https://github.com/weizard/assume-role.git ~/.oh-my-zsh/plugins/assume-role
```## Add Plugin to oh-my-zsh
```zsh
plugins=(... assume-role)
```## With oh-my-zsh theme "powerlevel9k"
add assume-role prompt
``` zsh
# 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
}
```## Auto input 2fa
You can use [2fa](https://github.com/rsc/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
``` zsh
export _2fa={2fa-name}
```