This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xdg-open custom_diagram.jpg # Opens the generated diagram in default image viewver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diagrams import Diagram, Cluster, Edge | |
from diagrams.custom import Custom | |
from diagrams.onprem.network import Nginx | |
from diagrams.onprem.network import Tomcat | |
from diagrams.onprem.inmemory import Memcached | |
from diagrams.onprem.queue import Rabbitmq | |
from diagrams.onprem.database import Mongodb | |
from diagrams.onprem.database import Mysql | |
from diagrams.elastic.elasticsearch import Elasticsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diagrams import Cluster, Diagram | |
from diagrams.aws.compute import ECS | |
from diagrams.aws.network import ELB, Route53 | |
from diagrams.aws.database import RDS | |
from diagrams.onprem.client import User | |
graph_attr = { | |
"fontsize": "25", | |
"bgcolor": "transparent" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xdg-open my_diagram.jpg # Opens the generated diagram in default image viewver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xdg-open simple_diagram.png # Opens the generated diagram in default image viewver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python3 1_basic_diagram.py # To run the file to generate diagram | |
ls -lrt # To check the files. A file called simple_diagram.png will be generated in the directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diagrams import Diagram # importing diagram package | |
from diagrams.aws.compute import EC2 # importing AWS EC2 resource | |
with Diagram("Simple Diagram"): # "Simple Diagram" is the name of the diagram. The image will be stored as "simple_diagram.png" | |
EC2("web") # An icon of EC2 will be generated with the name "web" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To install Diagrams | |
pip install diagrams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To install Graphviz | |
choco install graphviz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To check python version | |
python3 -V (or) python3 --version |