First we need to abstract using aws with sts AssumeRole. Put this file anywhere in your $PATH
~.local/bin/sts-aws
#!/usr/bin/env bash
set -euo pipefail
aws-sts() {
local account=$1First we need to abstract using aws with sts AssumeRole. Put this file anywhere in your $PATH
~.local/bin/sts-aws
#!/usr/bin/env bash
set -euo pipefail
aws-sts() {
local account=$1| # Source this file in bash: source /path/to/aws-sts.bash | |
| # Provides: | |
| # - aws-sts-activate (alias for aws_sts_activate) | |
| # - aws-sts-deactivate (alias for aws_sts_deactivate) | |
| # Behavior mirrors your Fish version: | |
| # * Loads/writes a cache file with credentials | |
| # * Assumes role when cache is missing/near expiry | |
| # * Shows the active profile in your prompt (left side, bash has no RPROMPT) | |
| # * Auto-refreshes creds when <=30m to expiry (pre-exec and pre-prompt) |