-
Notifications
You must be signed in to change notification settings - Fork 10
/
app.py
60 lines (51 loc) · 1.61 KB
/
app.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
#!/usr/bin/env python3
from aws_cdk import core
from eks_cluster.eks_stack import EKSWorkshop
nodejs_service_details = {
"service_name": "ecsdemo-nodejs",
"replicas": 3,
"labels": {
"app": "ecsdemo-nodejs"
},
"image": "brentley/ecsdemo-nodejs:latest",
"port": 3000,
"service_type": "backend"
}
crystal_service_details = {
"service_name": "ecsdemo-crystal",
"replicas": 3,
"labels": {
"app": "ecsdemo-crystal",
},
"image": "brentley/ecsdemo-crystal:latest",
"port": 3000,
"service_type": "backend"
}
frontend_service_details = {
"service_name": "ecsdemo-frontend",
"replicas": 3,
"labels": {
"app": "ecsdemo-frontend",
},
"image": "brentley/ecsdemo-frontend:latest",
"port": 3000,
"service_type": "frontend",
"env": [
{"name": "CRYSTAL_URL", "value": "http://ecsdemo-crystal.default.svc.cluster.local/crystal"},
{"name": "NODEJS_URL", "value": "http://ecsdemo-nodejs.default.svc.cluster.local/"},
]
}
# Cluster name: If none, will autogenerate
cluster_name = None
# Capacity details: Cluster size of small/med/large
capacity_details = "large"
# Fargate enabled: Create a fargate profile on the cluster
fargate_enabled = True
# Bottlerocket ASG: Create a self managed node group of Bottlerocket nodes
bottlerocket_asg = False
app = core.App()
EKSWorkshop(app, "cftc-demo", fargate_enabled=fargate_enabled,
capacity_details=capacity_details, bottlerocket_asg=bottlerocket_asg,
nodejs_service=nodejs_service_details, crystal_service=crystal_service_details,
frontend_service=frontend_service_details)
app.synth()