aws:list_accounts_in_org
list_accounts_in_organisations.sh
#!/bin/bash # Lists just the accounts in an organiation, # suitable for redirecting to a file to iterate over # for processing something in all accounts. # This gives a text output, the default is json, --output table is also valid. aws organizations list-accounts --query 'Accounts[*].[Id]' --output text # Using jq to parse the JSON aws organizations list-accounts | jq -r '.Accounts.[].Id'
aws/list_accounts_in_org.txt · Last modified: by andrew