The cool thing about this script is that it uses par-each
to run the aws commands in parallel and collecting the results. Do you know how hard that is to do in bash?!
Warning
This script assumes that you have 1 profile entry for each AWS account of the form <account alias>/aws-read-only
.
Adapt as needed.
aws configure list-profiles | grep aws-read-only | lines | par-each {|profile|