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 -e | |
# How to use this script: | |
# 1. Follow these instructions to configure a single AWS account to do initial login with SSO | |
# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html | |
# 2. Export AWS_PROFILE=... and then run "aws sso login" to get an SSO token | |
# 3. Once signed in with AWS SSO, run this script to automatically list out all the other accounts and roles and add them to your config file | |
# If you want to filter roles / accounts in the process, or validate config before committing it, you can customise the script to do this. |