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
# Add the following to your .zshrc or .bashrc | |
sso() { | |
local profile_name="$1" | |
# Check if the profile exists by attempting to get a known setting | |
if ! aws configure get sso_account_id --profile "$profile_name" &>/dev/null; then | |
echo "Profile '$profile_name' does not exist. Configuring AWS SSO profile..." | |
aws configure sso --profile "$profile_name" | |
fi |