Panfactum / stack

The Panfactum Stack
https://panfactum.com
Other
16 stars 5 forks source link

[feature]: Fuzzy search through aws profiles for sso login #65

Open wesbragagt opened 5 months ago

wesbragagt commented 5 months ago

Prior Search

What new functionality would you like to see?

It would be cool to have a pf-login utility that uses Fzf to fuzzy select through a list of available AWS profiles. I built a script for my team and figured I'd share the idea.

How would you use this new functionality?

#!/usr/bin/env bash
# This is a utility script for facilitating selecting profiles when using aws sso login

set -e

profile_selected=$(cat $AWS_CONFIG_FILE | grep profile | sed 's/^\[profile \(.*\)\]/\1/' | fzf)

if [ -z "$profile_selected" ]; then
    echo "No profile selected"
    exit 1
fi

aws --profile $profile_selected sso login

pf-login-demo