You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 line
1.0 KiB

  1. from diagrams import Diagram, Edge
  2. from diagrams.aws.cluster import *
  3. from diagrams.aws.compute import EC2
  4. from diagrams.onprem.container import Docker
  5. from diagrams.onprem.cluster import *
  6. from diagrams.aws.network import ELB
  7. with Diagram(name="", direction="TB", show=True):
  8. with Cluster("AWS"):
  9. with Region("eu-west-1"):
  10. with AvailabilityZone("eu-west-1a"):
  11. with VirtualPrivateCloud(""):
  12. with PrivateSubnet("Private"):
  13. with SecurityGroup("web sg"):
  14. with AutoScalling(""):
  15. with EC2Contents("A"):
  16. d1 = Docker("Container")
  17. with ServerContents("A1"):
  18. d2 = Docker("Container")
  19. with PublicSubnet("Public"):
  20. with SecurityGroup("elb sg"):
  21. lb = ELB()
  22. lb >> Edge(forward=True, reverse=True) >> d1
  23. lb >> Edge(forward=True, reverse=True) >> d2