https://github.com/bripkens/aws-vault-prompt
A zsh prompt for 99designs/aws-vault to understand what the active AWS session is and when it expires
https://github.com/bripkens/aws-vault-prompt
Last synced: about 1 year ago
JSON representation
A zsh prompt for 99designs/aws-vault to understand what the active AWS session is and when it expires
- Host: GitHub
- URL: https://github.com/bripkens/aws-vault-prompt
- Owner: bripkens
- License: mit
- Created: 2022-08-01T09:08:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-27T14:20:18.000Z (about 3 years ago)
- Last Synced: 2025-03-13T04:02:19.052Z (over 1 year ago)
- Language: Go
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-vault-prompt
A zsh prompt for [99designs/aws-vault](https://github.com/99designs/aws-vault) to understand what the active AWS session is and when it expires.
## Installation
Download the latest release from the [releases page](https://github.com/bripkens/aws-vault-prompt/releases) and put it on your `$PATH`.
## Configuration
The prompt is configured with the help of the `AWS_VAULT_TERM_PROMPT`, `AWS_VAULT_TERM_PROMPT_EXPIRING_SOON` and `AWS_VAULT_TERM_PROMPT_EXPIRED` environment variables.
All environments have to be golang format strings. You can use the following placeholders:
- `%[1]s`: Name of the AWS vault
- `%[2]s`: Name of the default AWS region
- `%[3]d`: Remaining session duration in minutes.
## Example zsh Config
Make sure to place these lines after: `source $ZSH/oh-my-zsh.sh`
```sh
export AWS_VAULT_TERM_PROMPT="$fg_bold[blue]aws:($fg_bold[cyan]%[1]s$fg_bold[blue])$reset_color "
export AWS_VAULT_TERM_PROMPT_EXPIRING_SOON="$fg_bold[blue]aws:($fg_bold[yellow]%[1]s ⏱ %[3]dm$fg_bold[blue])$reset_color "
export AWS_VAULT_TERM_PROMPT_EXPIRED="$fg_bold[blue]aws:($fg_bold[red]%[1]s ⚠️ $fg_bold[blue])$reset_color "
PROMPT=$PROMPT'$(aws-vault-prompt)'
```
This configuration will result in the following prompt:
### Valid Session

### Session that exprires soon

### Expired Session