Skip to main content

Continuous Documentation Tool - Documentation as Code Tool - This package create reverse diagrams based on your current state in your cloud environment using diagrams library

Project description

Table of Contents

Reverse Diagrams

Continuous Documentation Tool - Documentation as Code Tool

This package create reverse diagrams based on your current state in your cloud environment.

Install

pip install reverse-diagrams

Use

The 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]

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

For example:

❇️ 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/code

Then run python3 graph_org.py to create a png screenshot (organizations-state.png) for your current state.

Both files are saved into the current directory.

$  reverse_diagrams -c aws -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.png

For example:

Organizations Diagram

Now you can edit graph_org.py file or add to your repositories for keeping the documentation update.

Cloud Providers

AWS

Requirement

AWS programmatic access using AWS CLI. :arrow_right: Configuring the AWS CLI

Service supported

AWS Organizations

reverse_diagrams -c aws -p my-profile -o -r us-east-2

Identity and Access Manager Center (SSO)

reverse_diagrams -c aws -p my-profile -i -r us-east-2

Additional Commands

Combine the options

reverse_diagrams -c aws -p my-profile -o -i -r us-east-2

Extras

Enable autocomplete

Argcomplete 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 shell

  • You’re using argparse to manage your command line arguments/options

Argcomplete 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-argcomplete

and to make sure that bash knows about this script, you use

echo 'eval "$(register-python-argcomplete reverse_diagrams)"' >> ~/.bashrc
source ~/.bashrc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reverse_diagrams-1.0.4.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distribution

reverse_diagrams-1.0.4-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page