17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/miam/exporter.rb', line 17
def export
account_authorization_details = get_account_authorization_details
users = account_authorization_details[:user_detail_list]
groups = account_authorization_details[:group_detail_list]
roles = account_authorization_details[:role_detail_list]
policies = account_authorization_details[:policies]
instance_profiles = list_instance_profiles
group_users = {}
instance_profile_roles = {}
unless @options[:no_progress]
progress_total = users.length + groups.length + roles.length + instance_profiles.length
@progressbar = ProgressBar.create(
:format => ' %bᗧ%i %p%%',
:progress_mark => ' ',
:remainder_mark => '・',
:total => progress_total,
:output => $stderr)
end
expected = {
:users => export_users(users, group_users),
:groups => export_groups(groups),
:roles => export_roles(roles, instance_profile_roles),
:instance_profiles => export_instance_profiles(instance_profiles),
:policies => export_policies(policies),
}
[expected, group_users, instance_profile_roles]
end
|