-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
33 lines (26 loc) · 1.36 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
#!/usr/bin/env python3
import yaml
from aws_cdk import core
from webapp.vpc import VPCStack
from webapp.ec2 import Ec2Stack
from webapp.autoscaling import AutoscalingStack
# This will be commented in order to wait for feature request 'bootstrap_option' to be supported on launch template
# from webapp.eks import EKSStack
from webapp.rds import RDSStack
from webapp.cloudfront import CloudFrontStack
from webapp.alb import ALBStack
selected_env = core.Environment(account="658564819138", region="ap-southeast-1")
config = yaml.load(open('infra.yaml'), Loader=yaml.Loader)
app = core.App()
vpc = VPCStack(app,'vpc', env=selected_env)
ec2 = Ec2Stack(app, 'ec2', env=selected_env, vpc=vpc.vpc, config=config)
autoscaling = AutoscalingStack(app, 'autoscaling', env=selected_env, vpc=vpc.vpc, bastion=ec2.bastion, config=config)
# This will be commented in order to wait for feature request 'bootstrap_option' to be supported on launch template
# eks = EKSStack(app, 'eks', env=selected_env, vpc=vpc.vpc, config=config)
alb = ALBStack(app, 'alb', env=selected_env, vpc=vpc.vpc, asg=autoscaling.webapp_asg)
rds = RDSStack(app, 'rds', vpc=vpc.vpc, env=selected_env)
cloudfront = CloudFrontStack(app, 'cloudfront', env=selected_env)
core.Tags.of(app).add("Managed-By", "DevOps")
core.Tags.of(app).add("Provisioned-By", "AWS CDK")
core.Tags.of(app).add("CDK Language", "Python")
app.synth()