Created
January 19, 2022 21:51
-
-
Save enriched/cf71e0e0057d34ab9ecf52c39a6c0f95 to your computer and use it in GitHub Desktop.
AWS SSO Login with profile selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eo pipefail | |
PATTERN=${1} | |
SELECTED_PROFILE=$(cat ~/.aws/config | awk '/\[.+\]/{ gsub(/(\[profile[ ]+|\])/, ""); print }' \ | |
| fzf-tmux --height 30% --reverse -1 -0 --header 'Select AWS profile' --query "$PATTERN") | |
aws sso login --profile "$SELECTED_PROFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment