Open Olgoetz opened 4 years ago
The best I could do is use a blank Cluster
as a spacer.
However, with the current code base, the background colors of the Cluster
s are set automatically based on their nested depth so there is no way to make the spacer-Cluster
completely invisible without changing the code.
from diagrams import Cluster, Diagram
from diagrams.aws.compute import ECS, EKS, Lambda, EC2, AutoScaling
from diagrams.aws.database import RDS
from diagrams.aws.storage import S3
from diagrams.aws.network import ELB, InternetGateway
from diagrams.custom import Custom
with Diagram("Terraform Enterprise", show=False) as diag:
with Cluster("AWS Cloud"):
with Cluster("Availability\nZone 1"):
with Cluster("Public Subnet"):
squid_1 = EC2("Squid Proxy")
with Cluster("Private Subnet"):
rds_1= RDS("Postgre\nMain")
tfe_1 = EC2("Terraform\nEnterprise")
tfe_1 >> squid_1
with Cluster(""):
rds_1 - Edge(penwidth="0.0") - Custom("","transparent.png")
with Cluster("Availability\nZone 2"):
with Cluster("Private\nSubnet"):
tfe_2 = EC2("Terraform \nEnterprise")
rds_2= RDS("Postgre\nStandby")
with Cluster(""):
rds_2 - Edge(penwidth="0.0") - Custom("","transparent.png")
with Cluster("Public Subnet"):
squid_2 = EC2("Squid Proxy")
tfe_2 >> squid_2
[squid_1, squid_2] >> InternetGateway("IGW")
source = ELB("Application\nLoad\nBalancer")
source >> [tfe_1, tfe_2]
diag
Slight modification of above to merge the blank Cluster
with the "Public Subnet" Cluster
.
with Diagram("Terraform Enterprise", show=False) as diag:
with Cluster("AWS Cloud"):
with Cluster("Availability\nZone 1"):
with Cluster("Private Subnet"):
rds_1 = RDS("Postgre\nMain")
tfe_1 = EC2("Terraform\nEnterprise")
with Cluster("Public Subnet"):
rds_1 - Edge(penwidth="0.0") - Custom("","transparent.png")
squid_1 = EC2("Squid Proxy")
tfe_1 >> squid_1
with Cluster("Availability\nZone 2"):
with Cluster("Private\nSubnet"):
tfe_2 = EC2("Terraform \nEnterprise")
rds_2= RDS("Postgre\nStandby")
with Cluster("Public Subnet"):
squid_2 = EC2("Squid Proxy")
tfe_2 >> squid_2
rds_2 - Edge(penwidth="0.0") - Custom("","transparent.png")
[squid_1, squid_2] >> InternetGateway("IGW")
source = ELB("Application\nLoad\nBalancer")
source >> [tfe_1, tfe_2]
diag
Hi,
First of all, thanks a lot for this tool. I really like it a lot. At the momen, I am struggling with a proper alignment of nodes:
The result is:
By chaning the position of the RDS nodes, it should be fine. But I do not know how?