Skip to content

Conversation

@ankenyr
Copy link

@ankenyr ankenyr commented Jan 22, 2025

This change adds the ability to download from multiple accounts that are within an AWS organization. This is done by modifying the config file with new options.

  • accounts is either an empty list to collect all accounts or individual json objects to specify specific accounts within the organization.
    Each account object needs at minimum an Id and optionally a role if different from the default role.
  • defaultRole is the role used across all accounts (unless overridden by an account specific role). The user running the script will need the ability to assume the roles or else that account will raise an error when retrieving credentials.
  • useAccountName allows for each account directory to either be named after the ID or the human-friendly name.

The following is an example configuration including only changes.

{
  "accounts": [
 {
      "id": "1234",
      "role": "Engineer"
 },
 {
      "id": "5678"
 }
 ],
  "defaultRole": "Admin"
  "useAccountName": true
}

The outputs would look something like the following (I have cut out some of the JSON files to save space)

output3/aws_configs
├── Robert Ankeny
│   ├── ap-south-1
│   │   ├── Addresses.json
│   │   └── VpnGateways.json
│   └── us-west-2
│       ├── Addresses.json
│       └── VpnGateways.json
└── engineering
    ├── ap-south-1
    │   ├── Addresses.json
    │   └── VpnGateways.json
    └── us-west-2
        ├── Addresses.json
        └── VpnGateways.json

@ratulm ratulm self-requested a review January 22, 2025 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant