April 2019
Intermediate to advanced
508 pages
11h 57m
English
Now, just like before, we will want to save this data somewhere. We will store it in four separate files, users.json, groups.json, roles.json, and policies.json, with the following code:
# Import the json libraryimport json# Open up each file and dump the respective JSON into themwith open('./users.json', 'w+') as f: json.dump(user_details, f, indent=4, default=str)with open('./groups.json', 'w+') as f: json.dump(group_details, f, indent=4, default=str)with open('./roles.json', 'w+') as f: json.dump(role_details, f, indent=4, default=str)with open('./policies.json', 'w+') as f: json.dump(policy_details, f, indent=4, default=str)
This should end up with the final script (without comments) looking like the following: ...
Read now
Unlock full access