Package: reverse-diagrams
Table of ContentsReverse DiagramsRequirementInstallUseSubcommandswatchService supportedAWS OrganizationsIdentity and Access Manager Center (SSO)Additional CommandswatchOptionsCombine the optionsExtrasEnable autocompleteReverse DiagramsContinuous Documentation Tool - Documentation as Code ToolThis package create diagrams and help to audit your services from your shell.RequirementAWS programmatic access using AWS CLI.Configuring the AWS CLIInstallpip install reverse-diagramsUseThe following are the available options$ reverse_diagrams  -h
usage: reverse_diagrams [-h] [-p PROFILE] [-od OUTPUT_DIR_PATH] [-r REGION] [-o] [-i] [-a] [-v] [-d] {watch} ...

Create architecture diagram, inspect and audit your AWS services from your current state.

options:
  -h, --help            show this help message and exit
  -p PROFILE, --profile PROFILE
                        AWS cli profile for AWS Apis
  -od OUTPUT_DIR_PATH, --output_dir_path OUTPUT_DIR_PATH
                        Name of folder to save the diagrams python code files
  -r REGION, --region REGION
                        AWS region
  -o, --graph_organization
                        Set if you want to create graph for your organization
  -i, --graph_identity  Set if you want to create graph for your IAM Center
  -a, --auto_create     Create Automatically diagrams
  -v, --version         Show version
  -d, --debug           Debug Mode

Commands:
  Command and functionalities

  {watch}               reverse_diagrams Commands
    watch               Create pretty console viewexample: reverse_diagrams watch -wi diagrams/json/account_assignments.json

Thanks for using reverse_diagrams!For example:reverse_diagrams -p labvel-master -o -i -r us-east-1

❇️ Describe Organization 
❇️ Getting Organization Info
❇️ Listing Organizational Units 
❇️ Getting the Account list info
ℹ️  There are 11 Accounts in your organization
ℹ️  The accounts are stored in diagrams/json/organizations.json 
❇️ Creating diagrams in diagrams/code
❇️ Getting Identity store instance info
❇️ List groups
ℹ️  There are 10 Groups in your Identity Store
❇️ Get groups and Users info
Getting groups members... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:07
Getting account assignments ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:05:23
Create user and groups assignments ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
❇️ Getting account assignments, users and groups
ℹ️  The accounts are stored in diagrams/json/account_assignments.json
ℹ️  The accounts are stored in diagrams/json/groups.json
❇️ Creating diagrams in diagrams/codeThen runpython3 graph_org.pyto create a png screenshot (organizations-state.png) for your current state.Both files are saved into the current directory.$  reverse_diagrams -p labvel-master -o -r us-east-2
Date: 2022-12-17 22:44:07.623260
❇️ Getting Organization Info
❇️ The Organizational Units list 
❇️ Getting the Account list info
Run -> python3 graph_org.py 


$ python3 graph_org.py 
$ ls 
graph_org.py
organizations-state.pngFor example:Now you can editgraph_org.pyfile or add to your repositories for keeping the documentation update.SubcommandswatchWatch the result in console with a beautiful print style.reverse_diagrams  watch  -h
usage: reverse_diagrams watch [-h] [-wo WATCH_GRAPH_ORGANIZATION] [-wi WATCH_GRAPH_IDENTITY] [-wa WATCH_GRAPH_ACCOUNTS_ASSIGNMENTS]

Create view of diagrams in console based on kind of diagram and json file.

options:
  -h, --help            show this help message and exit

Create view of diagrams in console based on kind of diagram and json file.:
  -wo WATCH_GRAPH_ORGANIZATION, --watch_graph_organization WATCH_GRAPH_ORGANIZATION
                        Set if you want to see graph for your organization structure summary. For example: reverse_diagrams watch watch -wi diagrams/json/organizations.json        
  -wi WATCH_GRAPH_IDENTITY, --watch_graph_identity WATCH_GRAPH_IDENTITY
                        Set if you want to see graph for your groups and users. For example: reverse_diagrams watch watch -wi diagrams/json/groups.json
  -wa WATCH_GRAPH_ACCOUNTS_ASSIGNMENTS, --watch_graph_accounts_assignments WATCH_GRAPH_ACCOUNTS_ASSIGNMENTS
                        Set if you want to see graph for your IAM Center- Accounts assignments. For example: reverse_diagrams watch watch -wi
                        diagrams/json/account_assignments.json.jsoService supportedAWS Organizationsreverse_diagrams -p my-profile -o -r us-east-2Identity and Access Manager Center (SSO)reverse_diagrams -p my-profile -i -r us-east-2Additional CommandswatchYou can watch the configuration and summary in your shell based on json files generated previously.Options$ reverse_diagrams watch -h 
usage: reverse_diagrams watch [-h] [-wo WATCH_GRAPH_ORGANIZATION] [-wi WATCH_GRAPH_IDENTITY] [-wa WATCH_GRAPH_ACCOUNTS_ASSIGNMENTS]

Create view of diagrams in console based on kind of diagram and json file.

options:
  -h, --help            show this help message and exit

Create view of diagrams in console based on kind of diagram and json file.:
  -wo WATCH_GRAPH_ORGANIZATION, --watch_graph_organization WATCH_GRAPH_ORGANIZATION
                        Set if you want to see graph for your organization structure summary. For example: reverse_diagrams watch watch -wo diagrams/json/organizations.json
  -wi WATCH_GRAPH_IDENTITY, --watch_graph_identity WATCH_GRAPH_IDENTITY
                        Set if you want to see graph for your groups and users. For example: reverse_diagrams watch watch -wi diagrams/json/groups.json
  -wa WATCH_GRAPH_ACCOUNTS_ASSIGNMENTS, --watch_graph_accounts_assignments WATCH_GRAPH_ACCOUNTS_ASSIGNMENTS
                        Set if you want to see graph for your IAM Center- Accounts assignments. For example: reverse_diagrams watch watch -wa diagrams/json/account_assignments.jsonFor example, to watch account assignments:Combine the optionsreverse_diagrams  -p my-profile -o -i -r us-east-2ExtrasEnable autocompleteArgcomplete provides easy, extensible command line tab completion of arguments for your Python application.It makes two assumptions:You’re using bash or zsh as your shellYou’re using argparse to manage your command line arguments/optionsArgcomplete is particularly useful if your program has lots of options or subparsers, and if your program can dynamically suggest completions for your argument/option values (for example, if the user is browsing resources over the network).
Run:activate-global-python-argcompleteand to make sure that bash knows about this script, you useecho'eval "$(register-python-argcomplete reverse_diagrams)"'>>~/.bashrcsource~/.bashrc