-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharch.py
More file actions
74 lines (59 loc) · 2.54 KB
/
Copy patharch.py
File metadata and controls
74 lines (59 loc) · 2.54 KB
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
from diagrams import Diagram, Cluster, Edge
from diagrams.aws.network import VPC, PublicSubnet, PrivateSubnet, InternetGateway, NATGateway, Route53, ELB
from diagrams.aws.compute import EKS
from diagrams.aws.database import RDS
from diagrams.aws.storage import S3
from diagrams.aws.network import CloudFront
from diagrams.onprem.client import Users
# Configuration du diagramme
graph_attr = {
"fontsize": "16",
"bgcolor": "white",
"pad": "0.5",
}
with Diagram("Infrastructure Cloud SaaS - Multi-AZ Haute Disponibilité",
filename="architecture_aws",
show=False,
direction="TB",
graph_attr=graph_attr):
# Utilisateurs
users = Users("Utilisateurs")
# DNS
dns = Route53("Route53\nDNS")
# CloudFront + S3 pour Frontend
with Cluster("Frontend Distribution"):
cdn = CloudFront("CloudFront\nCDN")
s3_frontend = S3("S3\nFrontend Static")
# VPC
with Cluster("VPC Multi-AZ"):
igw = InternetGateway("Internet\nGateway")
# Application Load Balancer
alb = ELB("Application\nLoad Balancer\n(HTTPS/TLS)")
# Availability Zone 1
with Cluster("Availability Zone 1"):
with Cluster("Public Subnet AZ1"):
nat1 = NATGateway("NAT\nGateway 1")
with Cluster("Private Subnet AZ1"):
eks_nodes_1a = EKS("EKS Nodes\n(10-22 pods)")
rds_primary = RDS("RDS MySQL\nPrimary\nMulti-AZ")
# Availability Zone 2
with Cluster("Availability Zone 2"):
with Cluster("Public Subnet AZ2"):
nat2 = NATGateway("NAT\nGateway 2")
with Cluster("Private Subnet AZ2"):
eks_nodes_1b = EKS("EKS Nodes\n(10-22 pods)")
rds_standby = RDS("RDS MySQL\nStandby")
# Flux utilisateurs
users >> Edge(label="HTTPS") >> dns
dns >> Edge(label="Static Assets") >> cdn >> s3_frontend
dns >> Edge(label="API Requests") >> alb
# Flux interne
igw >> alb
alb >> Edge(label="Route Traffic") >> [eks_nodes_1a, eks_nodes_1b]
# NAT pour accès sortant
eks_nodes_1a >> Edge(label="Outbound\n(pull images, APIs)") >> nat1 >> igw
eks_nodes_1b >> Edge(label="Outbound\n(pull images, APIs)") >> nat2 >> igw
# Base de données
eks_nodes_1a >> Edge(label="DB Queries") >> rds_primary
eks_nodes_1b >> Edge(label="DB Queries") >> rds_primary
rds_primary >> Edge(label="Replication\nFailover", style="dashed") >> rds_standby