-
Notifications
You must be signed in to change notification settings - Fork 0
/
poc_aws_complex.py
133 lines (123 loc) · 3.99 KB
/
poc_aws_complex.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from diagrams_ext import Cluster, Diagram, Node, Edge
from diagrams_ext.generic.blank import Blank
from diagrams_ext.aws.network import (
NATGateway,
InternetGateway,
ElasticLoadBalancing,
TransitGateway,
VpnGateway,
)
from diagrams_ext.aws.database import RDSInstance
from diagrams_ext.aws.compute import EKS
from diagrams_ext.aws.storage import S3
from diagrams_ext.aws.management import Organizations, Cloudtrail
from diagrams_ext.aws.security import SingleSignOn
from diagrams_ext.onprem.iac import Terraform
from diagrams_ext.saas.identity import Auth0, Okta
from diagrams_patterns.aws import *
from diagrams_patterns import *
graph_attr = {"compound": "true", "splines": "line"}
with Diagram("dist/poc_aws_complex", show=False, direction="TB", graph_attr=graph_attr):
org = Organizations()
with Cluster("saas") as a:
Auth0()
okta = Okta()
with CloudCluster("root") as croot:
Terraform()
S3()
Cloudtrail()
sso = SingleSignOn()
tocluster(sso, okta, fontsize="20", label="SAML")
tocluster(org, sso)
with Cluster(
"Organization Units",
graph_attr={
"pencolor": "white",
"bgcolor": "transparent",
"fontcolor": "gray",
"fontsize": "50",
"labeljust": "c",
},
):
ou_attr = {
"pencolor": "black",
"style": "dashed",
"bgcolor": "transparent",
"fontcolor": "black",
}
tocluster(org, HiddenPoint())
with Cluster("mgmt", graph_attr=ou_attr):
with Cluster("demo"):
eks1 = EKS()
Cloudtrail()
with Cluster("corp"):
eks2 = EKS()
Cloudtrail()
with Cluster("auto"):
eks3 = EKS()
Cloudtrail()
with Cluster("network"):
# p = HiddenPoint()
p = VpnGateway()
tgw = TransitGateway()
peercluster(eks1, p)
peercluster(eks2, p)
peercluster(eks3, p)
with Cluster("audit"):
VpnGateway()
pa = TransitGateway()
with Cluster("identity"):
S3()
Terraform()
Cloudtrail()
p1 = HiddenPoint()
with Cluster("identity2"):
S3()
Terraform()
Cloudtrail()
p2 = HiddenPoint()
with Cluster("identity3"):
S3()
Terraform()
Cloudtrail()
p3 = HiddenPoint()
# p1 - p2 - p3
peercluster(p1, p2, p3, penwidth="0", minlen="1")
with Cluster("platform", graph_attr=ou_attr):
with Cluster("prod"):
s1 = S3()
peernodes(
EKS(),
Cloudtrail(),
penwidth="0",
)
peercluster(pa, s1, minlen="1")
peercluster(p, s1, minlen="3")
with Cluster("dev"):
s2 = S3()
peernodes(
EKS(),
Cloudtrail(),
penwidth="0",
)
peercluster(pa, s2, minlen="1")
peercluster(p, s2, minlen="3")
with Cluster("qa"):
s3 = S3()
peernodes(
EKS(),
Cloudtrail(),
penwidth="0",
)
peercluster(pa, s3, minlen="1")
peercluster(p, s3, minlen="3")
with Cluster("sandbox"):
s4 = S3()
peernodes(
EKS(),
Cloudtrail(),
penwidth="0",
)
peercluster(pa, s4, minlen="1")
peercluster(p, s4, minlen="3")
# peercluster(s1, s2, s3, s4, penwidth="0")