lib/miam/exporter.rb in miam-0.2.4.beta3 vs lib/miam/exporter.rb in miam-0.2.4.beta4
- old
+ new
@@ -253,15 +253,22 @@
:group_detail_list,
:role_detail_list,
:policies,
]
- keys.each do |key|
+ key_by_filter = {
+ 'User' => :user_detail_list,
+ 'Role' => :role_detail_list,
+ 'Group' => :group_detail_list,
+ 'LocalManagedPolicy' => :policies
+ }
+
+ key_by_filter.values.each do |key|
account_authorization_details[key] = []
end
- @iam.get_account_authorization_details.each do |resp|
- keys.each do |key|
+ Parallel.each(key_by_filter, :in_threads => @concurrency) do |filter, key|
+ @iam.get_account_authorization_details(:filter => [filter]).each do |resp|
account_authorization_details[key].concat(resp[key])
unless @options[:no_progress]
progressbar.increment
end