Created
June 7, 2024 12:43
-
-
Save fionn/393340d684bdb127e3690f1af86419a1 to your computer and use it in GitHub Desktop.
List AWS SSO accounts
This file contains 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
#!/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