def main(): with Diagram( "Architecture of the platform: The lady of the lake", show=True, direction='LR', filename='static/media/platform' ): from components.clusfront import clusfront from components.clustore import clustore from components.cluserve import cluserve from components.clusauth import clusauth from components.clusdoc import clusdoc from components.grphclus import grphclus from components.evclus import evclus, cluschema user = User('user') # nginx = Nginx('nginx') # nginx >> [clusfront, clustore, cluserve, clusauth, clusdoc, grphclus, evclus] clusfront >> Edge(label='/clustore', style='dashed') >> clustore clusfront >> Edge(label='/cluserve', style='dashed') >> cluserve clusfront >> Edge(label='/clusauth', style='dashed') >> clusauth clusfront >> Edge(label='/clusdoc', style='dashed') >> clusdoc clusfront >> Edge(label='/grphclus', style='dashed') >> grphclus cluserve >> Edge(style='dashed') >> [clustore, clusauth] clustore >> Edge(style='dashed') >> clusauth evclus >> cluserve user >> [clusfront, cluschema, clusdoc, grphclus]
from diagrams.programming.language import Python, Bash from diagrams.onprem.client import User, Client from diagrams.oci.storage import FileStorage from diagrams import Cluster, Diagram, Edge from diagrams.oci.governance import Logging from source.util.architecture.custom import Finansportalen, Finn, Posten, SIFO, Sqlite, SSB, \ Skatteetaten from source.util.architecture.settings import name, font_size with Diagram(name=name, show=False, direction="TB", outformat="pdf", node_attr={"fontsize": font_size}): users = User() gui = Client() bash = Bash("") main = Python("main") with Cluster("presentation layer (source/ui)", graph_attr={"fontsize": font_size}): with Cluster("package: views", graph_attr={"fontsize": font_size}): views = Python("views") with Cluster("forms", graph_attr={"fontsize": font_size}): forms = FileStorage("forms") with Cluster("logs", graph_attr={"fontsize": font_size}): ui_log = Logging("ui") with Cluster("package: models", graph_attr={"fontsize": font_size}):
from diagrams import Cluster, Diagram, Edge from diagrams.gcp.compute import KubernetesEngine from diagrams.gcp.database import Datastore, Memorystore, SQL from diagrams.gcp.network import LoadBalancing from diagrams.onprem.client import User os.chdir(os.path.dirname(__file__)) with Diagram( "Notebook to TAP", show=False, filename="notebook-tap", outformat="png", ): user = User("End User") with Cluster("Kubernetes"): ingress = LoadBalancing("NGINX Ingress") with Cluster("Nublado"): hub = KubernetesEngine("Hub") proxy = KubernetesEngine("Proxy") notebook = KubernetesEngine("Notebook") proxy >> hub hub >> notebook proxy >> notebook with Cluster("TAP"): tap = KubernetesEngine("TAP") schema = SQL("MySQL Schema DB")
from diagrams.aws.storage import ElasticFileSystemEFS from diagrams.aws.network import CloudMap from diagrams.aws.integration import ConsoleMobileApplication with Diagram("Graph6", show=True, outformat="png"): #STEP1:set up groups and entities with Cluster("GoSource"): gsIamUser = IdentityAndAccessManagementIamAWSSts("AWS IAM User") gsServer = TradicionalServer("MacOS Build Server") with Cluster("Internet"): with Cluster("Github"): genericSamlToken = GenericSamlToken("oAuth Authentication Provider") codeRepo = Storage("Code Repositories") with Cluster("Application Developers"): adUser = User(" ") with Cluster("AWS Cloud"): with Cluster("Jenkins CI/CD Pipeline"): jcpELB = ElasticLoadBalancing("Load Balancer") with Cluster("Jenkins Service"): jsECS = ECS("ECS Container") with Cluster("Jenkins Agent Workers"): jawECS1 = ECS("ECS Container") jawECS2 = ECS("ECS Container") jawECS3 = ECS("ECS Container") with Cluster("Shared Storage"): ssEFS = ElasticFileSystemEFS("EFS FileSystem") with Cluster("Product Accounts"):
#!/usr/bin/env python3 from diagrams.aws.general import GenericSamlToken from diagrams import Diagram, Edge, Cluster from diagrams.onprem.security import Vault from diagrams.onprem.vcs import Github from diagrams.onprem.client import User graph_attr = {"fontsize": "15", "pad": "0.5", "bgcolor": "transparent"} with Diagram( show=False, filename="../../img/vault_github_plugin", graph_attr=graph_attr, ): user = User("Authenticated User") with Cluster("https://vault.acme.corp"): vault_plugin = [Vault("GitHub Plugin")] key = GenericSamlToken("GitHub App\nPrivate Key") with Cluster("https://api.github.com"): app = Github("GitHub App") user << Edge( color="black", style="bold", label=""" 1. GET /github/token X-Vault-Token: <Vault token>""", ) << vault_plugin << Edge( color="black", style="bold",
from diagrams import Diagram, Cluster from diagrams.onprem.compute import Server from diagrams.onprem.network import Internet from diagrams.oci.network import LoadBalancer from diagrams.onprem.iac import Terraform from diagrams.onprem.client import User with Diagram("Load balanced application on droplets", show=False, direction="LR"): internet = Internet("Internet") internet with Cluster("home"): user = User("you") terraform = Terraform("terraform apply") user >> terraform >> internet with Cluster("DigitalOcean"): pub_lb = LoadBalancer("pub-lb-burrito-prod") web0 = Server("web0-burrito-prod") web1 = Server("web1-burrito-prod") internet >> pub_lb pub_lb >> web0 pub_lb >> web1
from diagrams.onprem.client import Client, User # aws resources from diagrams.aws.compute import EC2, ECS from diagrams.aws.storage import S3 from diagrams.aws.general import TradicionalServer, GenericSamlToken from diagrams.aws.engagement import SimpleEmailServiceSes from diagrams.aws.network import ElasticLoadBalancing from diagrams.aws.database import RDS, Elasticache from diagrams.aws.analytics import ElasticsearchService from diagrams.aws.storage import EBS with Diagram("Graph4-simplified", show=True, outformat="png"): #STEP1:set up groups and entities with Cluster("Internet"): with Cluster("Trusted External Parties"): tepUser = User("") tepDevice = Client("") with Cluster("Dept"): with Cluster("Department Staff"): dsUser = User("") dsDevice = Client("") with Cluster("Department SAML SSO"): tradicionalServer = TradicionalServer("") genericSamlToken = GenericSamlToken("") with Cluster("AWS Cloud"): simpleEmailServiceSes = SimpleEmailServiceSes("Simple Email Service") with Cluster("Jira"): jELB = ElasticLoadBalancing("Load Balancer")
from diagrams import Diagram, Cluster from diagrams.aws.compute import EC2 from diagrams.aws.network import ELB from diagrams.aws.network import Route53 from diagrams.onprem.client import User from diagrams.onprem.database import Cassandra, Oracle, PostgreSQL from diagrams.onprem.inmemory import Redis from diagrams.onprem.monitoring import Prometheus, Grafana from diagrams.onprem.network import Internet from diagrams.onprem.queue import Kafka from other import Infinispan, Ibmmq with Diagram("Web services infrastructure Diagram", show=False, direction='TB'): user = User("User") support = User("Support") internet = Internet("Internet") with Cluster("Own infrastructure"): load_balancer = ELB("Load Balancer") with Cluster("service node\n(Datacenter 'DC1')"): service1 = EC2("Server node 1\n(Scala)") infinispan1 = Infinispan("Distributed node cache\n(Infinispan)") with Cluster("service node\n(Datacenter 'DC2')"): service2 = EC2("Server node 2\n(Scala)") infinispan2 = Infinispan("Distributed node cache\n(Infinispan)") service1 >> infinispan1 service2 >> infinispan2 prometheus = Prometheus("Prometheus")
from diagrams import Cluster, Diagram, Edge from diagrams.onprem.client import Client, User # aws resources from diagrams.aws.compute import Lambda from diagrams.aws.network import CloudFront from diagrams.aws.mobile import APIGateway from diagrams.aws.storage import S3 with Diagram("Graph1", show=True, outformat="png"): with Cluster("Public"): with Cluster("Public"): user = User("") device = Client("") with Cluster("AWS Cloud"): with Cluster("Web App"): cloudFrontD = CloudFront("CloudFront Distribution") lambda1 = Lambda("Lambda Function") s3 = S3("S3 Bucket") with Cluster("Processing API"): api = APIGateway("API Gateway") lambda2 = Lambda("Lambda Function") #format within Public section user - Edge(color="transparent") - device #connect within Web App section cloudFrontD >> Edge( style="dashed",
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, Cluster, Edge from diagrams.aws.compute import Lambda from diagrams.aws.network import APIGateway from diagrams.aws.storage import S3 from diagrams.onprem.client import User from diagrams.onprem.ci import TravisCI from diagrams.onprem.vcs import Git from diagrams.onprem.compute import Server from diagrams.programming.language import Rust with Diagram("Lambda Rust Test", show=False): developer = User("Developer") travis = TravisCI("TravisCI") codecov = Server("Codecov") rust = Rust("Rust") with Cluster("Serverless Offline (Local)"): local_api_gateway = APIGateway("API Gateway (Virtual)") local_lambda = Lambda("Lambda (Virtual)") local_s3 = S3("S3 (Virtual)") local_api_gateway >> local_lambda >> local_s3 with Cluster("Github"): master_branch = Git("branch (master)") release_branch = Git("branch (release)") with Cluster("AWS (release)"): release_lambda = Lambda("Lambda") release_api_gateway = APIGateway("API Gateway") release_s3 = S3("S3") release_api_gateway >> release_lambda >> release_s3
from diagrams import Cluster, Diagram, Edge from diagrams.onprem.compute import Server from diagrams.onprem.network import Envoy from diagrams.onprem.queue import Kafka from diagrams.onprem.client import User with Diagram(name="Example", show=False): with Cluster("Back End"): services = [Server("service1"), Server("service2"), Server("service3")] with Cluster("Front End"): gateway = Envoy("HTTP/2 SSE\n/events?userId=...") user = User("frontend") frontend = [gateway, user] gateway << Edge(style="dotted") >> user services >> Kafka() >> gateway
# diagram.py from diagrams import Diagram from diagrams.onprem.iac import Terraform from diagrams.onprem.client import User, Users with Diagram("Terraform Cloud Organization", show=False, direction="RL"): Terraform("tfe organization") << [User("admin"), Users("membership")]
from diagrams.aws.compute import ECS, Lambda from diagrams.aws.storage import S3 from diagrams.aws.general import TradicionalServer, GenericSamlToken from diagrams.aws.engagement import SimpleEmailServiceSes from diagrams.aws.network import ElasticLoadBalancing from diagrams.aws.database import RDS, Elasticache from diagrams.aws.analytics import ElasticsearchService from diagrams.aws.security import Cognito from diagrams.aws.mobile import APIGateway from diagrams.aws.integration import SQS with Diagram("Graph5", show=True, outformat="png"): with Cluster("Public and Rangers"): with Cluster("Public"): pUser = User("") pDevice = Client("") with Cluster("Rangers"): rUser = User("") rDevice = Mobile("") with Cluster("Dept"): with Cluster("Department Staff"): dsUser = User("") dsDevice = Client("") with Cluster("Department SAML SSO"): tradicionalServer = TradicionalServer("") genericSamlToken = GenericSamlToken("") with Cluster("AWS Cloud"):
from diagrams import Cluster, Diagram, Edge from diagrams.aws.network import Cloudfront from diagrams.aws.storage import S3 from diagrams.onprem.client import Users, User from diagrams.aws.compute import Lambda from diagrams.aws.network import APIGateway from diagrams.onprem.compute import Server with Diagram("Dynamic Rendering Lambda Edge", show=False): with Cluster("SPA Site"): cf = Cloudfront("Cloudfront") s3 = S3("static\nhosting") vreq = Lambda("Viewer\nRequest") oreq = Lambda("Origin\nRequest") api = APIGateway("Dynamic\nRendering\nAPI") users = Users("User") crawler = User("Crawler") users >> cf crawler >> cf cf >> vreq >> Edge(label="add header") >> oreq oreq >> Edge(label="if user") >> s3 oreq >> Edge(label="if crawler") >> api >> Edge(label="as user") >> cf
from diagrams import Cluster, Diagram, Edge from diagrams.aws.compute import Lambda from diagrams.aws.compute import ECS from diagrams.aws.storage import S3 from diagrams.aws.database import RDS from diagrams.aws.integration import SNS from diagrams.aws.management import Cloudwatch from diagrams.aws.network import APIGateway from diagrams.onprem.compute import Server from diagrams.onprem.client import User with Diagram("BLT Kata final container diagram", show=True): payment_gw = Server("Payment Gateway") customer = User("Customer") marketing = User("Marketing") with Cluster("System"): with Cluster("Promotions"): promotions_cms = ECS("CMS") promotions_gw = APIGateway("Promotions API") promotions_be = Lambda("Promotions BE") promotions_cms >> promotions_gw >> promotions_be with Cluster("In Store"): printer_fe = S3("Docket Printer Front-end") docket_printer = Server("Docket Printer") cashier = User("Cashier") store_fe = S3("Store Front-end") store_api = APIGateway("Store API") store_be = Lambda("Store BE")
"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")
#!/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
from diagrams import Diagram from diagrams.aws.compute import Lambda, ECS from diagrams.aws.devtools import Codebuild from diagrams.aws.integration import Eventbridge from diagrams.aws.database import Dynamodb, Timestream from diagrams.onprem.client import User with Diagram("SLO Infrastructure", direction="TB"): ci = Codebuild("CI/CD") producer = Eventbridge("Event Bus") function = Lambda("Event Handler") event_store = Dynamodb("EventStore") series_store = Timestream("SLO/Events") stores = [event_store, series_store] grafana = ECS("Dashboard") user = User() ci >> producer >> function >> stores user >> grafana >> series_store
return Edge(color=color, style=style) with Diagram("ECS Service Pipeline", filename="diagram", outformat="png"): github = Github("GitHub Actions\nImage Build") with Cluster("Management AWS Account"): with Cluster("ECR-Source Module"): ecr = ECR("ECR Repository") with Cluster("Pipeline Module"): pipeline_source = Codepipeline("ECR Source") pipeline_dev = Codepipeline("Deploy to\nDev") pipeline_approval_staging = User("Manual\nApproval") pipeline_staging = Codepipeline("Deploy to\nStaging") pipeline_approval_prod = User("Manual\nApproval") pipeline_prod = Codepipeline("Deploy to\nProd") with Cluster("Development AWS Account"): with Cluster("Service Module"): cfn_dev = Cloudformation("CloudFormation\nStack") with Cluster("CloudFormation Resources"): ecs_dev = ECS("ECS Service") task_dev = Compute("ECS Tasks") with Cluster("Staging AWS Account"): with Cluster("Service Module"): cfn_staging = Cloudformation("CloudFormation\nStack") with Cluster("CloudFormation Resources"):
from diagrams import Diagram, Cluster from diagrams.gcp.compute import Run from diagrams.gcp.devtools import Build, GCR, SourceRepositories as GSR from diagrams.gcp.database import SQL from diagrams.onprem.vcs import Github from diagrams.onprem.client import Client, User with Diagram("Architecture", show=False): with Cluster("Apps"): with Cluster("CI/CD"): dev = GSR("source mirror") cicd = dev >> Build("build") >> GCR("container deploy") with Cluster("Services"): app = Run("Rails + React App") cicd >> app >> SQL("database") User("developer") >> Github("code push") >> dev Client("client") >> app
from diagrams import Cluster, Diagram, Edge from diagrams.onprem.client import User from diagrams.gcp.compute import Run from diagrams.gcp.devtools import Build from diagrams.onprem.vcs import Github graph_attr = {"pad": "0"} with Diagram("Vulnerable API protected", graph_attr=graph_attr) as waf_diagram: github_1 = Github("GitHub repo") with Cluster("API project"): build = Build("Cloud Build") waf = Run("WAF") api = Run("API") user = User("Hacker") github_1 >> Edge(label="Build Trigger", color="black") >> build >> Edge( label="Deploy", style="dotted") >> waf build >> Edge(label="Deploy", style="dotted") >> api waf - Edge() - api user - Edge(label="https") - waf
#!/bin/python3 from diagrams import Cluster, Diagram, Edge from diagrams.onprem.client import User from diagrams.aws.compute import ECS from diagrams.aws.storage import S3 from diagrams.aws.network import Route53, CloudFront, ALB from diagrams.aws.database import RDS from diagrams.aws.devtools import Codedeploy from diagrams.onprem.ci import GithubActions from diagrams.onprem.vcs import Github with Diagram(name="ningenme.net", filename="public/diagrams/diagram", show=False): user = User("Client") with Cluster("AWS"): with Cluster("route53"): route53NingenmeNet = Route53("ningenme.net") route53ApiNingenmeNet = Route53("api.ningenme.net") route53StaticNingenmeNet = Route53("static.ningenme.net") with Cluster("cloud front"): cloudFrontNingenmeNet = CloudFront("ningenme.net") cloudFrontApiNingenmeNet = CloudFront("api.ningenme.net") cloudFrontStaticNingenmeNet = CloudFront("static.ningenme.net") with Cluster("s3"): s3StaticNingenmeNet = S3("static.ningenme.net") with Cluster("alb"): albNetFront = ALB("net-front") albNetApi = ALB("net-api") with Cluster("ecs-cluster"): ecsNetFront = ECS("net-front")
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
# aws resources from diagrams.aws.compute import ECS from diagrams.aws.storage import S3 from diagrams.aws.general import TradicionalServer, GenericSamlToken from diagrams.aws.engagement import SimpleEmailServiceSes from diagrams.aws.network import ElasticLoadBalancing from diagrams.aws.database import RDS, Elasticache from diagrams.aws.analytics import ElasticsearchService from diagrams.aws.security import Cognito with Diagram("Graph3", show=True, outformat="png"): #STEP1:set up groups and entities with Cluster("Public"): with Cluster("Observer"): oUser = User("") oDevice = Mobile("") with Cluster("Dept"): with Cluster("Department Staff"): dsUser = User("") dsDevice = Client("") with Cluster("AWS Cloud"): with Cluster("Mobile Updates"): s3 = S3("S3 Bucket") with Cluster("Management App"): elb = ElasticLoadBalancing("Load Balancer") maECS = ECS("ECS Container")
from diagrams.aws.general import TradicionalServer from diagrams.aws.security import IdentityAndAccessManagementIam, IdentityAndAccessManagementIamRole, IdentityAndAccessManagementIamAWSSts from diagrams.aws.storage import ElasticFileSystemEFS from diagrams.aws.network import CloudMap, CloudFront from diagrams.aws.integration import ConsoleMobileApplication, SimpleNotificationServiceSns with Diagram("Graph7", show=True, outformat="png", direction="TB"): with Cluster("Azure AD"): with Cluster("Mobile App Authentication Domain"): genericSamlToken1 = GenericSamlToken("Application Registration") with Cluster("Web App Authentication Domain"): genericSamlToken2 = GenericSamlToken("Application Registration") with Cluster("Airports"): aUser = User("Officer") aDevice = Mobile("") with Cluster("Dept Offices"): doUser1 = User("Config Editor") doDevice1 = Client("") doUser2 = User("Analyst") doDevice2 = Client("") with Cluster("AWS"): with Cluster("Mobile App System Authentication"): cognito1 = Cognito("Cognito Userpool") with Cluster("Web App System Authentication"): cognito2 = Cognito("Cognito Userpool")
def draw(): with Diagram("Example Microservice for EBA", show=False, graph_attr=graph_attr, direction="LR"): staff = Client('EBA Staff') organinzer = User("EBA Organinzer") users = Users("EBA Users") mobileApp = Flutter("EBA Mobile") dns = DNS('Cloud DNS') loadbalance = LoadBalancing('Cloud Loadbalancing') auth = Authentication("Firebase Auth") users >> Edge(color="darkgreen") >> mobileApp << Edge( color="darkgreen") >> auth [organinzer, staff] << Edge(color="darkgreen") >> dns dns << Edge(color="darkgreen") >> loadbalance with Cluster("Google Cloud Platform", graph_attr=graph_attr2): with Cluster("WEB Frontend", graph_attr=graph_attr2): with Cluster("Web Container1", graph_attr=graph_attr2): web1 = Hosting("Firebase Hosting") react1 = React("Frontend") web1 - react1 with Cluster("Web Container2", graph_attr=graph_attr2): web2 = Hosting("Firebase Hosting") react2 = React("Frontend") web2 - react2 with Cluster("WEB Backend", graph_attr=graph_attr2): with Cluster("Web Backend Container"): web3 = Hosting("Firebase Hosting") react3 = React("Backend") web3 - react3 loadbalance << Edge(color="darkgreen") >> [web1, web2, web3] with Cluster("APIs", graph_attr=graph_attr2): func = Functions("Cloud Functions") remoteCnf = RemoteConfig("RemoteConfig") [react1, react2, react3] << Edge( color="darkgreen") >> remoteCnf << Edge( color="darkgreen") >> func with Cluster("Feeds", graph_attr=graph_attr2): apiFeeds = NodeJS("Express") with Cluster("Tournaments", graph_attr=graph_attr2): apiTournament = NodeJS("Express") with Cluster("Badges", graph_attr=graph_attr2): apiBadges = NodeJS("Express") with Cluster("User", graph_attr=graph_attr2): apiUser = NodeJS("Express") with Cluster("Games", graph_attr=graph_attr2): apiGames = NodeJS("Express") with Cluster("Notifications", graph_attr=graph_attr2): apiNotifications = NodeJS("Express") auth << Edge(color="darkgreen") >> func >> Edge(color="darkorange") >> [apiBadges, apiUser, apiFeeds, apiGames, apiNotifications, apiTournament] with Cluster("Database", graph_attr=graph_attr2): badgesSQL = SQL("Badges") userSQL = SQL("User") notificationSQL = SQL("Notifications") tournamentsSQL = SQL("Tournaments") gamesSQL = SQL("Games") feedsSQL = SQL("Feeds") apiBadges - Edge(color="darkorange") - badgesSQL apiUser - Edge(color="darkorange") - userSQL apiFeeds - Edge(color="darkorange") - feedsSQL apiGames - Edge(color="darkorange") - gamesSQL apiNotifications - Edge(color="darkorange") - notificationSQL apiTournament - Edge(color="darkorange") - tournamentsSQL firestore = Firestore("Firestore") with Cluster("Message Queue", graph_attr=graph_attr2): messageQueue = Pubsub("Pubsub") [badgesSQL, userSQL, notificationSQL, tournamentsSQL, gamesSQL, feedsSQL] >> Edge(color="darkorange") >> messageQueue messageQueue >> Edge(color="darkred") >> firestore >> Edge(color="darkred", style="dotted") >> [apiBadges, apiUser, apiFeeds, apiGames, apiNotifications, apiTournament] with Cluster("Storage", graph_attr=graph_attr2): badgesStorage = Storage("Badges") userStorage = Storage("User") gameStorage = Storage("Games") tournamentsStorage = Storage("Tournaments") apiBadges - Edge(color="blue") - badgesStorage apiUser - Edge(color="blue") - userStorage apiGames - Edge(color="blue") - gameStorage apiTournament - Edge(color="blue") - tournamentsStorage fcm = Messaging("Cloud Messaging") apiNotifications >> \ Edge(color="darkorange") >> \ fcm >> Edge(color="darkgreen") >> auth
# aws resources from diagrams.aws.compute import ECS from diagrams.aws.storage import S3 from diagrams.aws.general import TradicionalServer, GenericSamlToken from diagrams.aws.engagement import SimpleEmailServiceSes from diagrams.aws.network import ElasticLoadBalancing from diagrams.aws.database import RDS, Elasticache with Diagram("Graph2-simplified-test123", show=True, outformat="png", direction="TB"): #STEP1:set up groups and entities with Cluster("Public"): with Cluster("Client"): pUser = User("") pDevice = Client("") with Cluster("Dept"): with Cluster("Bio Security Officer"): bsoUser = User("") bsoDevice = Mobile("") with Cluster("Delegated Officer"): doUser = User("") doDevice = Client("") with Cluster("Department SAML SSO"): tradicionalServer = TradicionalServer("") genericSamlToken = GenericSamlToken("")
from diagrams import Cluster, Diagram from diagrams.aws.database import Dynamodb from diagrams.aws.storage import S3 from diagrams.aws.security import KMS # from diagrams.aws.general import User from diagrams.onprem.client import User from diagrams.onprem.iac import Terraform with Diagram("AWS S3 Backend", show=False): tf = Terraform("") user = User("DevOps") with Cluster("AWS"): aws = [S3("TF State"), Dynamodb("TF LockTable"), KMS("Encryption Key")] user >> tf >> aws
with Cluster("Data load"): storage = S3("Data storage") download = ECS("ECS download task") unzip_trigger = Lambda("S3 event trigger") unzip = ECS("ECS unzip task") with Cluster("Data processing"): parse = Glue("Glue Spark XML\nparser") catalog = GlueDataCatalog("Data Catalog") with Cluster("Feature engineering"): train_features = Glue("Glue Spark job:\ntrain features") predict_features = Glue("Glue Spark job:\nprediction features") prediction_db = Dynamodb("Prediction database") with Cluster("ML model"): cluster = EMRCluster("EMR Cluster") model_fit = Spark("Spark + MLeap") model = Sagemaker("Sagemaker endpoint") with Cluster("Serving"): app = Internet("Web app") api = APIGateway("REST API") predict_trigger = Lambda("Request/response\nhandler") user = User("End user") source >> download >> storage >> unzip_trigger >> unzip >> storage storage >> parse >> catalog catalog >> [train_features, predict_features] predict_features >> prediction_db >> predict_trigger train_features >> cluster >> model_fit >> model predict_trigger >> model >> predict_trigger storage >> app user >> Edge() << app >> api >> predict_trigger >> api >> app