Last active
July 17, 2021 16:00
-
-
Save podhmo/7e9a6d947a49651de6c2088a621c46d9 to your computer and use it in GitHub Desktop.
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.database import ElastiCache, RDS | |
from diagrams.aws.network import ELB | |
from diagrams.aws.network import Route53 | |
# https://diagrams.mingrammer.com/docs/getting-started/examples | |
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_main = RDS("userdb") | |
db_main - [RDS("userdb ro")] | |
memcached = ElastiCache("memcached") | |
dns >> lb >> svc_group | |
svc_group >> db_main | |
svc_group >> memcached |
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.database import ElastiCache, RDS | |
from diagrams.aws.network import ELB | |
from diagrams.aws.network import Route53 | |
def draw(name: str, *, show: bool = False) -> None: | |
with Diagram(name): | |
dns = Route53() | |
lb = ELB() | |
with Cluster() as Services: | |
web1 = ECS() | |
web2 = ECS() | |
web3 = ECS() | |
with Cluster() as DBCluster: | |
userdb = RDS() | |
userdb_ro = RDS() | |
userdb - [userdb_ro] | |
memcached = ElastiCache() | |
dns >> lb >> Services | |
Services >> DBCluster | |
Services >> memcached |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment