Skip to content

Instantly share code, notes, and snippets.

View saudkhanzada's full-sized avatar
🎯
Focusing

Saud Khanzada saudkhanzada

🎯
Focusing
View GitHub Profile
@saudkhanzada
saudkhanzada / sso.sh
Created May 28, 2024 12:59
Getting AWS credentials using AWS SSO
# 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