Skip to content

Instantly share code, notes, and snippets.

@fionn
Created June 7, 2024 12:43
Show Gist options
  • Save fionn/393340d684bdb127e3690f1af86419a1 to your computer and use it in GitHub Desktop.
Save fionn/393340d684bdb127e3690f1af86419a1 to your computer and use it in GitHub Desktop.
List AWS SSO accounts
#!/bin/bash
set -euo pipefail
access_token="$(jq -r .accessToken < $(ls -1U ~/.aws/sso/cache/*.json | head -n 1))"
aws sso list-accounts --access-token "$access_token" --output table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment