Aaron

Update aws_users_export.py

... ... @@ -31,23 +31,12 @@ import argparse
# )
###
def get_all_headers(data):
keys = []
for item in data:
for key in item.keys():
if key not in keys:
keys.append(key)
return keys
if __name__ == '__main__':
# Parse CLI args
argp = argparse.ArgumentParser(description='Export AWS users to CSV')
argp.add_argument('--file', '-f', dest='outfile',
action='store', help='CSV file to export data into')
action='store', help='File to export JSON data into')
argp.add_argument('--verbose-policies', '-p', dest='policies',
action='store_true', help='Export full policy details')
args = argp.parse_args()
... ... @@ -111,10 +100,6 @@ if __name__ == '__main__':
user_data[user['UserName']]['InlineUserPolicies'] = user_inline_policy_data['PolicyNames']
user_data[user['UserName']]['AttachedUserPolicies'] = user_attached_policy_data['AttachedPolicies']
#user_inline_policy_data = client.get_user_policy(
#user_attached_policy_data = client.list_attached_user_policies(UserName=user['UserName'])
#user_data[user['UserName']]['Policies'] = policy_data['PolicyNames']
tag_data = client.list_user_tags(UserName=user['UserName'])
user_data[user['UserName']]['Tags'] = tag_data['Tags']
... ...