Enumerating all your AWS accounts

Substrate will maintain substrate.accounts.txt in your Substrate repository as you create new admin and service accounts, providing a reference that's close at hand and even committed to version control (in case AWS is well and truly broken). The substrate accounts command updates that file and then prints it out. But it accepts a -format option, too.

substrate accounts -format json makes it easy to program against your list of accounts. It's equivalent to the organizations:ListAccounts API with each account decorated with its tags, making domain, environment, and quality accessible, too.

substrate accounts -format shell prints a shell program that will run the appropriate Substrate command against every account in your organization. This is mighty convenient during Substrate upgrades or in CI/CD systems, especially when combined with the environment variable TF_CLI_ARGS="-auto-approve".

Last updated