aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Add support for iterating over regions and accounts in CLI

Open ablackrw opened this issue 3 years ago • 0 comments

Issue #, if available: Prototype implementation for #7173

Description of changes: The goal of this change is to provide a simple way to execute a particular command in multiple regions and accounts. The implemented mechanism is roughtly an order of magnitude faster in execution time than iterating using a shell loop.

For account iteration, the organizations:ListAccounts facility is leveraged to provide a list of accounts to iterate over. The sts:AssumeRole service is then used to obtain access to the identified accounts using role switching.

For region switching, a client is created for each enumerated region. This facility uses a new command line switch rather than overloading the --region switch to allow the account iteration to function correctly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ablackrw avatar Aug 15 '22 19:08 ablackrw