You've already forked Curso-lenguaje-python
Add diagrams test
This commit is contained in:
28
catch-all/07_diagrams_as_code/02_cluster_web.py
Normal file
28
catch-all/07_diagrams_as_code/02_cluster_web.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
from diagrams import Cluster, Diagram
|
||||
from diagrams.aws.compute import ECS
|
||||
from diagrams.aws.database import ElastiCache, RDS
|
||||
from diagrams.aws.network import ELB
|
||||
from diagrams.aws.network import Route53
|
||||
|
||||
with Diagram("Clustered Web Services", show=False):
|
||||
dns = Route53("dns")
|
||||
lb = ELB("lb")
|
||||
|
||||
with Cluster("Services"):
|
||||
svc_group = [
|
||||
ECS("web1"),
|
||||
ECS("web2"),
|
||||
ECS("web3")
|
||||
]
|
||||
|
||||
with Cluster("DB Cluster"):
|
||||
db_primary = RDS("userdb")
|
||||
db_primary - [RDS("userdb ro")]
|
||||
|
||||
memcached = ElastiCache("memcached")
|
||||
|
||||
dns >> lb >> svc_group
|
||||
svc_group >> db_primary
|
||||
svc_group >> memcached
|
||||
Reference in New Issue
Block a user