def main(): with Diagram("Home Network", show=False, filename="output/home_network", outformat="png"): internet = Internet("internet") with Cluster("192.168.0.1/24"): router = Router("Synology RT2600ac") # SynologyRouter switch = Switch("Netgear R7000") raspberrypi = Server("Raspberry Pi 4 8GB") # raspberrypi raspberrypi_docker = Docker("Docker") devices = Client("Devices") internet >> router internet << router router >> raspberrypi router >> switch router >> devices switch >> devices with Cluster("10.0.0.0/28"): service_nginx_proxy = Nginx("nginx-proxy") service_grafana = Grafana("Grafana") service_pi_hole = DNS("Pi-hole") service_portainer = LinuxGeneral("Portainer") service_telegraf = LinuxGeneral("Telegraf") service_prometheus = Prometheus("Prometheus") service_loki = Loki("Loki") service_promtail = Loki("Promtail") raspberrypi >> raspberrypi_docker raspberrypi_docker >> service_nginx_proxy service_nginx_proxy >> service_grafana service_nginx_proxy >> service_pi_hole service_nginx_proxy >> service_portainer service_nginx_proxy >> service_telegraf service_nginx_proxy >> service_prometheus service_nginx_proxy >> service_loki service_nginx_proxy >> service_promtail service_prometheus >> Edge(label="collect metrics", color="firebrick", style="dashed") >> service_telegraf service_promtail >> Edge(label="push logs", color="firebrick", style="dashed") >> service_loki service_grafana >> Edge(label="query", color="firebrick", style="dashed") >> service_prometheus service_grafana >> Edge(label="query", color="firebrick", style="dashed") >> service_loki
"fontsize": "12", "labelfontsize": "10", "height": "200.0", "center": "false" } with Diagram("Event Flows - Service proxy", filename="service-proxy", show=False, graph_attr=graph_attr): with Cluster("Example deployment"): with Cluster("Colony Registry Cluster"): dns = DNS("registry1") dns2 = DNS("registry...") with Cluster("Docker Host ..."): i2 = Nginx("App proxy") with Cluster("Applications"): b1 = [Docker("www"), Docker("api"), Docker("mysql2")] with Cluster("Docker Host 1"): i1 = Nginx("App Proxy") with Cluster("Applications"): a1 = [Docker("www"), Docker("api"), Docker("mysql1")] i1 >> a1 i2 >> b1 dns >> Edge(label="DNS Response A host2 IP") >> i2 dns >> Edge(label="DNS Response A host1 IP") >> i1
from diagrams import Diagram from diagrams.onprem.vcs import Github from diagrams.onprem.ci import GithubActions from diagrams.onprem.container import Docker with Diagram("Flow", show=False, direction="LR"): Github("Github") >> GithubActions("GithubActions") >> Docker("Docker")
def main(): graph_attr = { "fontsize": "45", 'overlap_scaling': '100', 'size': '24!', 'ratio': 'expand' } with Diagram(name='Automation Framework Swarm', direction='LR', graph_attr=graph_attr): with Cluster('Docker Cluster'): docker = Docker('Docker') with Cluster('container1'): python_container = Python('APIs\nOther Microservices') with Cluster('Kafka Cluster'): with Cluster('Zookeeper'): Zookeeper('Zookeeper\ntcp:2181') with Cluster('REST Proxy'): rest_proxy = Custom('REST Proxy\ntcp:8082', 'custom_icons/REST-API.png') with Cluster('Control Center'): control_center = Kafka('Control Center\ntcp:9021') with Cluster('Schema Registry'): schema_registry = Storage('Schema Registry\ntcp:8081') with Cluster('Brokers'): broker_1 = Kafka('Broker 1\ntcp:9092') kafka_brokers = [ broker_1, Kafka('Broker 2\ntcp:9093'), Kafka('Broker 3\ntcp:9094') ] with Cluster('Secrets Managers'): vault = Vault('HashiCorp Vault\ntcp:8200') secrets_managers = [ vault, ] with Cluster('Logging and Search'): with Cluster('Search and Logging'): elastic_search = Elasticsearch('Elastic Search\ntcp:9200') kibana = Kibana('Kibana\ntcp:5601') logstash = Logstash('Logstash\ntcp:5044') search_log = [ elastic_search, kibana, logstash ] with Cluster('Inventory and Connectivity'): with Cluster('Inventory'): nautobot = Custom('Nautobot\ntcp:8000', 'custom_icons/Nautobot.jpeg') kafka_brokers - python_container python_container - vault python_container - nautobot nautobot - logstash python_container - logstash
from diagrams.onprem.compute import Server from diagrams.onprem.container import Docker from diagrams.aws.compute import EKS, Lambda from diagrams.aws.database import Redshift from diagrams.aws.integration import SQS from diagrams.aws.storage import S3 from diagrams.oci.connectivity import DNS from diagrams.onprem.client import Client graph_attr = { "pad": "0", "fontsize": "10", "labelfontsize": "10", "height": "200.0", "center": "false" } with Diagram("Event Flows - DNS Service Discovery", filename="service-resolution", show=False, graph_attr=graph_attr): with Cluster("Example deployment"): with Cluster("Docker hosts, Applications"): c1 = [Docker("host1"), Docker("...")] with Cluster("Colony Registries"): r1 = Server("registry1") r2 = Server("...") e = Edge(label="DNS Query") c1[0] >> e >> r1 c1[0] >> e >> r2
from diagrams import Cluster, Diagram from diagrams.programming.language import Nodejs from diagrams.onprem.network import Nginx from diagrams.onprem.container import Docker from diagrams.onprem.database import Mongodb from diagrams.programming.language import Java from diagrams.generic.storage import Storage with Diagram("Bot para desarrollo", show=False): proxy = Storage("Proxy") bot = Nodejs("bot") kbase = Java("Kbase") mongodb = Mongodb("mongodb") docker = Docker("docker") proxy >> bot >> mongodb proxy >> kbase >> mongodb >> docker
from diagrams import Diagram, Cluster, Edge from diagrams.onprem.container import Docker from diagrams.onprem.iac import Terraform, Ansible from diagrams.custom import Custom graph_attr = {"fontsize": "45", "bgcolor": "transparent", "dpi": "300"} with Diagram("", show=False, filename="value_stream", graph_attr=graph_attr): image = Docker("Docker Image") docker_role = Ansible("Ansible Role Docker") app_role = Ansible("Ansible Role App") packer_ami = Custom("AMI", "packer.png") terrafor_module = Terraform("Module") terrafor_stack = Terraform("Deployment") image >> app_role >> packer_ami docker_role >> packer_ami >> terrafor_module >> terrafor_stack
from diagrams.onprem.container import Docker from diagrams.generic.database import SQL from diagrams.generic.storage import Storage NUM_CLIENTS = 3 NUM_SQL_SERVICES = 2 NUM_STORAGE_SERVICES = 1 with Diagram("JWThenticator API Gateway Example Architecture"): with Cluster("Service Runtime"): api_gateway = Envoy("api-gateway") services = [] with Cluster("Secured Endpoints"): for i in range(NUM_SQL_SERVICES + NUM_STORAGE_SERVICES): services.append(Docker(f"service-{i}")) with Cluster("Registry Endpoints"): client_registry = Docker("client-registry") with Cluster("Unrestricted Endpoints"): jwthenticator_external = Docker("external-jwthenticator") with Cluster("Internal Services"): jwthenticator_internal = Docker("internal-jwthenticator") with Cluster("Services Dependencies"): jwthenticator_db = SQL("jwthenticator-db") services_deps = [] for i in range(NUM_SQL_SERVICES): services_deps.append(SQL(f"service-{i}-db"))
from diagrams import Diagram, Cluster from diagrams.onprem.network import Nginx, Tomcat from diagrams.onprem.database import Postgresql from diagrams.onprem.client import User from diagrams.onprem.container import Docker with Diagram("", show=False, filename="infrastructure"): user = User("Web Browser") nginx = Nginx("Nginx") db = Postgresql("PG-DB") web = Docker("RedMine") user >> nginx >> web >> db
from diagrams import Diagram from diagrams.onprem.container import Docker from diagrams.onprem.compute import Server with Diagram("Nextcloud containerized", show=False): Server("Debian") >> Docker("Haproxy") >> Docker("Nextcloud") >> Docker( "Mariadb")
from diagrams.k8s.network import Ingress from diagrams.onprem.client import Client from diagrams.onprem.container import Docker from diagrams.generic.database import SQL NUM_CLIENTS = 3 NUM_SECURE_SERVICES = 2 with Diagram("JWThenticator Direct Validation Example Architecture"): with Cluster("Service Runtime"): ingress = Ingress("ingress") services = [] jwthenticator = Docker("jwthenticator") jwthenticator_db = SQL("jwthenticator-db") with Cluster("Secured Endpoints"): for i in range(NUM_SECURE_SERVICES): services.append(Docker(f"service-{i}")) # General initial flow for i in range(NUM_CLIENTS): Client(f"client-{i}") >> ingress # pylint: disable=expression-not-assigned for i in range(NUM_SECURE_SERVICES): ingress >> services[i] >> jwthenticator # JWThenticator service ingress >> jwthenticator
class Cloudflare(Custom): def __init__(self, label): super(Cloudflare, self).__init__(label, './img/cloudflare_icon.png') with Diagram("Provisioning flow", graph_attr=graph_attr, outformat="jpg", show=False): controller = Server("Controller") with Cluster("./metal") as metal: metals = Server("Metal cluster") pxe = Docker("PXE server") rockies = Rocky('Rocky Linux') initial_resources = [metals, pxe] k3s = K3s('K3s') rockies >> k3s metals >> rockies controller >> initial_resources with Cluster("./bootstrap") as bootstrap: nodes = Node('Node(s)') argocd = ArgoCD('ArgoCD') root_chart = Helm("Root chart") k3s >> nodes
aurora_autoscaling_group_instances = [ Aurora("Primary Instance"), Aurora("Aurora Replica"), Aurora("Aurora Replica"), ] aurora_autoscaling_group = AutoScaling("Aurora Autoscaling") with Cluster("Container Service"): container_service = ECS("Amazon ECS") task = ElasticContainerServiceService("Tasks") app_container = ElasticContainerServiceContainer("Container (app)") nginx_container = ElasticContainerServiceContainer("Container (nginx)") with Cluster("Container Registry"): registry = EC2ContainerRegistryRegistry("Amazon ECR") app_image = Docker("Image (app)") nginx_image = Docker("Image (nginx)") ci_pipeline = Circleci("CI Pipeline") terraform_repo = Terraform("Infra as code") remote_state = S3("Remote State") ssl_certificate - dns_name dns_name - load_balancer load_balancer - public_subnets public_subnets[0] - nat_gateways[0] public_subnets[1] - nat_gateways[1] public_subnets[2] - nat_gateways[2] nat_gateways[0] - private_subnets[0] nat_gateways[1] - private_subnets[1] nat_gateways[2] - private_subnets[2]
from diagrams import Diagram, Cluster from diagrams.onprem.container import Docker from diagrams.generic.network import Firewall from diagrams.aws.management import Cloudwatch, ParameterStore from diagrams.aws.storage import EFS from diagrams.aws.compute import ECS with Diagram("AWS ECS Task Definition", show=False, direction="TB"): with Cluster("task definition"): image = Docker("image") ports = Firewall("ports") logging = Cloudwatch("logging") environment = ECS("environment") secrets = ParameterStore("secrets") health_check = ECS("health check") mount_points = EFS("mount points")
from diagrams import Diagram from diagrams.onprem.client import Users from diagrams.onprem.container import Docker from diagrams.programming.framework import Spring graph_attr = { "fontsize": "20", "bgcolor": "white" # transparent } with Diagram("", direction="LR", graph_attr=graph_attr, outformat="png", filename="testing_architecture"): users = Users("Integration Tests") backend = Spring("Application") database = Docker("PostgreSQL database") backend >> database users >> backend
# diagram.py from diagrams import Cluster, Diagram, Edge from diagrams.onprem.container import Docker from diagrams.saas.chat import Discord from diagrams.custom import Custom from urllib.request import urlretrieve #Pterodactyl pterodactyl_url = "https://avatars.githubusercontent.com/u/16179146" pterodactyl_icon = "pterodactyl.png" urlretrieve(pterodactyl_url, pterodactyl_icon) with Diagram(filename="second_network", show=True): with Cluster("Dedicated Ubuntu Server"): with Cluster("Bungee Network 2"): proxy2 = Docker("Proxy 2") modded = Docker("Modded") creative = Docker("Creative") minigames = Docker("Minigames") proxy2 >> Edge(color="darkgreen") >> modded proxy2 >> Edge(color="darkgreen") >> creative proxy2 >> Edge(color="darkgreen") >> minigames ingamechat = Discord("#modded_ingamechat") modded >> ingamechat
backblaze_icon = "backblaze.png" urlretrieve(backblaze_url, backblaze_icon) #Restic restic_url = "https://restic.readthedocs.io/en/latest/_static/logo.png" restic_icon = "restic.png" urlretrieve(restic_url, restic_icon) with Diagram(filename="restic_backblaze", show=True, direction="TB"): backblaze = Custom("Backblaze B2 Storage", backblaze_icon) with Cluster("Dedicated Ubuntu Server"): with Cluster("Game Servers"): proxy1 = Docker("Proxy 1") proxy2 = Docker("Proxy 2") survival = Docker("Survival") resource = Docker("Resource") creative = Docker("Creative") modded = Docker("Modded") minigames = Docker("Minigames") snapshot = Docker("Snapshot") gamenight = Docker("Gamenight") misc = Docker("Misc. Servers") restic = Custom("Restic", restic_icon) servers = [ misc, snapshot, gamenight, minigames, modded, creative, resource, survival, proxy2, proxy1
from diagrams.onprem.ci import Jenkins from diagrams.onprem.container import Docker from diagrams.onprem.database import MySQL, MongoDB from diagrams.onprem.network import Nginx from diagrams.onprem.vcs import Github from diagrams.programming.framework import Django, Backbone with Diagram("CFO-Architecture", show=False): user = User('User') dns = DNS("DNS") with Cluster('Toast Single Instance'): web_server = Nginx('Nginx') with Cluster('Docker'): was = Docker('Docker Container') was - Django('Django') with Cluster('Database'): database = MySQL('MySQL 8.0') with Cluster('CI/CD'): with Cluster('NHN'): nhn_jenkins = Github('NHN Github') nhn_jenkins - Jenkins('NHN Jenkins') with Cluster('Accommate'): acm_jenkins = Jenkins('Accommate Jenkins') user >> dns >> web_server >> was >> database nhn_jenkins >> acm_jenkins >> was
from diagrams.onprem.client import Client graph_attr = { "pad": "0", "fontsize": "10", "labelfontsize": "10", "height": "200.0", "center": "false" } with Diagram("Example Service Registration", filename="service-discovery", show=False, graph_attr=graph_attr): with Cluster("Example deployment"): with Cluster("Docker Hosts, Colony Agents"): other = [Docker("...")] master = Docker("host1") with Cluster("Colony Registries"): r2 = Server("...") r1 = Server("registry1") e = Edge(label="Service registration") master >> Edge(label="Service registration", labelfloat="false", label_scheme="0") >> r1 master >> r2 other[0] >> [r1, r2]
from diagrams import Cluster, Diagram from diagrams.onprem.client import User from diagrams.onprem.container import Docker with Diagram("System Diagram", show=False): user = User("User camera") with Cluster("Shared network"): cont_ffmpeg = Docker('ffmpeg server') with Cluster("Processing"): cont_inference = Docker('inference') with Cluster("App and stats"): cont_webapp = Docker('ui') cont_mqtt = Docker('mqtt server') app = (cont_inference >> [cont_mqtt, cont_webapp]) user >> cont_ffmpeg >> cont_inference
"fontsize": "20", "bgcolor": "white" #transparent } with Diagram("Application Architecture", graph_attr=graph_attr, outformat="png", filename="application_architecture"): ELB("lb") >> EC2("web") >> RDS("userdb") >> S3("store") ELB("lb") >> EC2("web") >> RDS("userdb") << EC2("stat") (ELB("lb") >> EC2("web")) - EC2("web") >> RDS("userdb") with Cluster("Application Context"): app = EC2("Spring Boot") ELB("lb") >> app metrics = Prometheus("metric") metrics << Edge(color="firebrick", style="dashed") << Grafana("monitoring") Jenkins("CI") client = Client("A") client >> User("B") >> Users("S") client >> PostgreSQL("Database") client >> Internet("Remote API") client >> Docker("Docker") client >> Server("Server") client >> SQS("Sync Books") client >> Spring("Backend") client >> React("React")
from diagrams import Cluster, Diagram, Edge from diagrams.onprem.container import Docker from diagrams.custom import Custom from urllib.request import urlretrieve #Pterodactyl pterodactyl_url = "https://avatars.githubusercontent.com/u/16179146" pterodactyl_icon = "pterodactyl.png" urlretrieve(pterodactyl_url, pterodactyl_icon) with Diagram(filename="bots", show=True, direction="TB"): with Cluster("Dedicated Ubuntu Server"): pterodactyl = Custom("Pterodactyl", pterodactyl_icon) with Cluster("Bots"): emojirolesbot = Docker("Emoji Roles Bot") modbot = Docker("Modbot") applicationbot = Docker("Application Bot") playerlistbot = Docker("Playerlist Bot") snackerinactivitybot = Docker("Snacker/Inactvity Bot") musicbot = Docker("Music Bot") chester = Docker("Chester") ergobot = Docker("ErGoBot") bots = [ ergobot, musicbot, playerlistbot, emojirolesbot, snackerinactivitybot, chester, modbot, applicationbot ] pterodactyl >> Edge(color="#004da4") >> bots
from diagrams import Cluster, Diagram from diagrams.onprem.network import Apache from diagrams.gcp.network import VPC from diagrams.onprem.container import Docker from diagrams.onprem.network import Nginx from diagrams.gcp.network import Routes with Diagram("Stack", show=False): with Cluster("GCP"): dns1 = Routes("app1.com.br") dns2 = Routes("app2.com.br") dns3 = Routes("app3.com.br") with Cluster("VPC"): google_vpc = VPC("VPC Google Cloud") nginx = Nginx("Virtualhosts - Proxy_Pass") docker_app1 = Docker("app1") docker_app2 = Docker("app2") docker_app3 = Docker("app3") apache_app1 = Apache("index.html") apache_app2 = Apache("index.html") apache_app3 = Apache("index.html") dns3 >> google_vpc >> nginx >> docker_app1 >> apache_app3 dns2 >> google_vpc >> nginx >> docker_app2 >> apache_app2 dns1 >> google_vpc >> nginx >> docker_app3 >> apache_app1
def main(): graph_attr = { "fontsize": "45", 'overlap_scaling': '100', 'size': '24!', 'ratio': 'expand' } with Diagram(name='Automation Framework Compose', direction='LR', graph_attr=graph_attr): with Cluster('Docker Cluster'): docker = Docker('Docker') with Cluster('container1'): python_container = Python('APIs\nOther Microservices') with Cluster('Docker Registry'): docker_registry_container = Docker('Docker Registry\ntcp:5000') with Cluster('Docker Registry Browser'): docker_registry_browser_container = Python( 'Docker Registry Browser\ntcp:8088') with Cluster('BatFish'): batfish_container = Custom( 'BatFish\ntcp:8888\ntcp:9997\ntcp:9996', 'custom_icons/BatFish.png') with Cluster('Kafka Cluster'): with Cluster('Zookeeper'): Zookeeper('Zookeeper\ntcp:2181') with Cluster('REST Proxy'): rest_proxy = Custom('REST Proxy\ntcp:8082', 'custom_icons/REST-API.png') with Cluster('Control Center'): control_center = Kafka('Control Center\ntcp:9021') with Cluster('Schema Registry'): schema_registry = Storage('Schema Registry\ntcp:8081') with Cluster('Brokers'): broker_1 = Kafka('Broker 1\ntcp:9092') kafka_brokers = [ broker_1, Kafka('Broker 2\ntcp:9093'), Kafka('Broker 3\ntcp:9094') ] with Cluster('Secrets Managers'): vault = Vault('HashiCorp Vault\ntcp:8200') secrets_managers = [ vault, ] with Cluster('Logging and Search'): with Cluster('ELK Stack'): elastic_search = Elasticsearch('Elastic Search\ntcp:9200') kibana = Kibana('Kibana\ntcp:5601') logstash = Logstash('Logstash\ntcp:5044') search_log = [elastic_search, kibana, logstash] with Cluster('Influxdb'): infulxdb = Influxdb('Influxdb\ntcp:8086') with Cluster('Grafana'): grafana = Grafana('Grafana\ntcp:3000') with Cluster('Inventory and Connectivity'): with Cluster('Inventory'): nautobot = Custom('Nautobot\ntcp:8000', 'custom_icons/Nautobot.jpeg') with Cluster('Database'): with Cluster('Mongo dB'): mongodb = Mongodb('MongoDb\ntcp:27017') mongodb_express = Mongodb('MongoDb Express\ntcp:8181') mongo_group = [mongodb, mongodb_express] with Cluster('CI/CD'): team_city = TC('TeamCity') kafka_brokers - python_container python_container - vault python_container - nautobot nautobot - logstash python_container - logstash nautobot - infulxdb python_container - infulxdb python_container - mongodb
from urllib.request import urlretrieve from diagrams.generic.blank import Blank with open("icons.json", "r") as fd: icons = json.load(fd) for k in icons: i = icons[k] if i["url"] is not None and not os.path.isfile(i["icon"]): urlretrieve(i["url"], i["icon"]) with Diagram("Infrastructure", direction="TB"): internet = Custom("", icons["cloudflare"]["icon"]) with Cluster("Pi Cluster", direction="TB"): docker = Docker() with Cluster("Pi 1", direction="TB") as pi1: controller = Docker("Docker Swarm Manager") glusterfs1 = Glusterfs("glusterfs") with Cluster("Pi 2", direction="TB") as pi2: agent = Docker("Docker Swarm Node") glusterfs2 = Glusterfs("glusterfs") with Cluster("Containers"): with Cluster("External"): cloudflared = Custom("cloudflared", icons["cloudflareCloud"]["icon"]) traefik = Traefik("traefik") with Cluster("Internal"):
from diagrams.saas.chat import Discord from diagrams.custom import Custom #phpMyAdmin phpmyadmin_url = "https://upload.wikimedia.org/wikipedia/commons/4/4f/PhpMyAdmin_logo.svg" phpmyadmin_icon = "phpmyadmin.png" urlretrieve(phpmyadmin_url, phpmyadmin_icon) with Diagram(filename="proxy_servers", show=True): applications = Discord("#applications") with Cluster("Dedicated Ubuntu Server"): with Cluster("Bots"): applicationbot = Docker("Application Bot") with Cluster("Game Servers - Bungee Network 2"): proxy2 = Docker("Proxy 2") with Cluster("Game Servers - Bungee Network 1"): proxy1 = Docker("Proxy 1") with Cluster("MySQL / MariaDB"): maindb = MariaDB("Databases") phpmyadmin = Custom("phpMyAdmin", phpmyadmin_icon) applications >> Edge(color="#7289DA") >> applicationbot applicationbot >> proxy1 applicationbot >> proxy2
from diagrams import Diagram, Edge from diagrams.onprem.database import PostgreSQL from diagrams.onprem.queue import Kafka from diagrams.onprem.container import Docker with Diagram("Monitoring Application", show=False): Docker("Monitoring service") >> Edge(color="black", style="bold") >> Kafka( "stream" ) >> Edge(color="black", style="bold") >> Docker("Consumer service") >> Edge( color="black", style="bold" ) >> PostgreSQL( "storage" )
urlretrieve(dynmap_url, dynmap_icon) with Diagram(filename="main_network", show=True, direction="LR"): # applications = Discord("#applications") ingamechat = Discord("#ingamechat") with Cluster("Dedicated Ubuntu Server"): # applicationbot = Docker("Application Bot") dynmap = Custom("Dynmap", dynmap_icon) paddingdynmap = Blank("") with Cluster("Bungee Network 1"): proxy1 = Docker("Proxy 1") padding1 = Blank("") resource = Docker("Resource") survival = Docker("Survival") padding2 = Blank("") proxy1 - Edge(penwidth="0.0") - padding1 proxy1 >> Edge(color="darkgreen") << survival proxy1 >> Edge(color="darkgreen") << resource proxy1 - Edge(penwidth="0.0") - padding2 with Cluster("MySQL / MariaDB"): maindb = MariaDB("Databases") phpmyadmin = Custom("phpMyAdmin", phpmyadmin_icon) # applications >> Edge(color="#7289DA") >> applicationbot
from diagrams import Cluster, Diagram, Edge from diagrams.k8s.compute import Pod from diagrams.k8s.compute import Deployment from diagrams.k8s.compute import ReplicaSet from diagrams.onprem.container import Docker with Diagram("kubernetes configuration files", show=False): depl = Deployment("Deployment") rs = ReplicaSet("ReplicaSet") pod = Pod("Pod") docker = Docker("Container") depl >> rs >> pod >> docker
from diagrams.onprem.iac import Terraform, Ansible graph_attr = {"bgcolor": "transparent", "dpi": "300"} with Diagram( "Example Project", show=True, filename="clustered_web_services_example", graph_attr=graph_attr, ): with Cluster("Multi-Region"): lb = ELB("ELB") with Cluster("Services"): autoscaling = AutoScaling("autoscaling-group") svc_group = [EC2("web-01"), EC2("web-02")] lb >> autoscaling >> svc_group with Cluster("AMI"): docker = Docker("Docker") with Cluster("Docker Image"): app = Python("App") svc_group - docker docker - Edge(style="dotted") - app