Skip to content

Instantly share code, notes, and snippets.

@unacceptable
Last active July 24, 2021 10:46
Show Gist options
  • Save unacceptable/8a2916e0cbd1da540b5dedffa8d994a3 to your computer and use it in GitHub Desktop.
Save unacceptable/8a2916e0cbd1da540b5dedffa8d994a3 to your computer and use it in GitHub Desktop.
while read -r AWS_PROFILE; do
for CLUSTER in $(aws eks list-clusters --profile "$AWS_PROFILE" --query clusters --output text); do
aws eks update-kubeconfig --name "$CLUSTER" --profile "$AWS_PROFILE"
done
done < <(
grep "^\[.*\]$" ~/.aws/credentials | sed 's/\[//;s/\]//;s/profile //'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment