Skip to content

Instantly share code, notes, and snippets.

View BaluVyamajala's full-sized avatar

Balu Vyamajala BaluVyamajala

  • Grand Rapids, Mi
View GitHub Profile
@BaluVyamajala
BaluVyamajala / auto_configure_aws_cli_sso_roles.sh
Created July 28, 2024 19:16 — forked from lukeplausin/auto_configure_aws_cli_sso_roles.sh
Automatically configure AWS SSO configuration file for all available accounts and roles
#!/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.