#!/usr/bin/python3 from diagrams import Cluster, Diagram, Edge from diagrams.onprem.compute import Server from diagrams.onprem.database import Mysql from diagrams.onprem.network import Nginx graph_attr = {"fontsize": "45", "bgcolor": "white"} with Diagram("Infra as <Code> - Cluster TB", direction="TB", filename="diagrama_infra_as_code_cluster_tb", graph_attr=graph_attr): with Cluster("VLAN APP-WEB"): with Cluster("Cluster Servidores"): servers = [Server("Server1"), Server("Server2"), Server("Server3")] with Cluster("VLAN DataBase"): mysqldb = Mysql("MySQL") slb = Nginx("Server-LB") slb >> servers >> mysqldb
from diagrams import Cluster, Diagram from diagrams.onprem.database import Mssql, Mysql, MariaDB, Oracle, Postgresql from diagrams.azure.database import SQLDatabases, SQLManagedInstances, SQLServers, DatabaseForMysqlServers, DatabaseForMariadbServers, DatabaseForPostgresqlServers from diagrams.aws.database import RDS, Aurora, Database node_attr = {"fontsize": "20"} graph_attr = {"fontsize": "28"} with Diagram("", show=False, direction="TB", node_attr=node_attr): with Cluster("On-Premises", graph_attr=graph_attr): with Cluster("Commercial Platforms", graph_attr=graph_attr): closed_source = [Oracle(""), Mssql("")] with Cluster("Open Source Platforms", graph_attr=graph_attr): with Cluster(""): mysql = Mysql("") mysql >> [MariaDB("MariaDB")] open_source = [mysql, Postgresql("PostgreSQL")] with Cluster("Cloud", graph_attr=graph_attr): with Cluster("Azure", graph_attr=graph_attr): with Cluster("SQL Server", graph_attr=graph_attr): azure = [ SQLDatabases("\nAzure SQL\nDatabase"), SQLManagedInstances("\n\nSQL\nManaged\nInstances"), SQLServers("\nSQL Server\n(IaaS)") ] with Cluster("Other", graph_attr=graph_attr): azure2 = [ DatabaseForMysqlServers("\nMySQL"), DatabaseForMariadbServers("\nMariaDB"),
#!/usr/bin/python3 from diagrams import Diagram from diagrams import Cluster, Diagram, Edge from diagrams.onprem.compute import Server from diagrams.onprem.network import Haproxy, Internet from diagrams.onprem.database import Mysql from diagrams.onprem.network import Nginx, Linkerd from diagrams.onprem.client import User graph_attr = {"fontsize": "45", "bgcolor": "white"} with Diagram("Infra as <Code> - Arestas", direction="TB", filename="diagrama_infra_as_code_arestas", outformat="png", graph_attr=graph_attr): with Cluster("Cluster Servidores"): servers_fe = [Server("Server1"), Server("Server2"), Server("Server3")] web_user = User("User") web_lb = Nginx("Nginx") mysql_db = Mysql("MySql-DB") www_net = Internet("Internet") web_user>>Edge(color="black", label="TCP/443")>>www_net >>Edge(color="green", label="TCP/443") >> \ web_lb >> Edge(color="orange", label="TCP/80", style="dotted" ) >> servers_fe >> Edge(color="red", label="TCP/3306" , style="dashed") >> mysql_db
frontend = [ Server("fe-server-01"), Server("fe-server-02"), Server("fe-server-03") ] backend_lb = Nginx("Backend-LB") with Cluster("Backend Cluster"): backend = [ Server("be-server-01"), Server("be-server-02"), Server("be-server-03") ] Mysql_db = Mysql("MySQL-DB") with Cluster("Redis Cluster"): master = Redis("Master") master - Redis("Replica") with Cluster("Metrics"): metrics = Prometheus("Metric") metrics << Grafana("Monitoring") frontend_lb = Nginx("Frontend-LB") internet = Internet("Internet") webuser = Users("User") webuser >> Edge(color="black", label="TCP/443") >> internet >> Edge(color="black", label="TCP/443") >> \ frontend_lb >> Edge(color="darkgreen", label="TCP/80") >> frontend >> Edge(color="darkgreen", label="TCP/80") >> \