Skip to content

Instantly share code, notes, and snippets.

@mims92
Created January 3, 2020 08:43
Show Gist options
  • Save mims92/ad548e5eeb2d24f7297b5e31bcef2de9 to your computer and use it in GitHub Desktop.
Save mims92/ad548e5eeb2d24f7297b5e31bcef2de9 to your computer and use it in GitHub Desktop.
AWS - Bash - List all accounts id and name of the organization
#!/bin/bash
#chmod +x /usr/bin/awsaccounts
#Usage: awsaccounts
aws organizations list-accounts --profile <profile name> | jq -r -e '["ID","", "NAME"], (.Accounts[] | [.Id, .Name] ) | @tsv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment