-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
44 lines (32 loc) · 922 Bytes
/
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
#!/usr/bin/env python3
import os
import aws_cdk as cdk
from dotenv import load_dotenv
# Load Target ENV variables
load_dotenv(
dotenv_path=".env-{envars_file}".format(envars_file=os.getenv("ENVARS_FILE"))
)
print(f'ENVARS_FILE: {os.getenv("ENVARS_FILE")}')
## Define AWS Deploy environment
deploy_env = cdk.Environment(
account=os.environ.get("CDK_DEPLOY_ACCOUNT"),
region=os.environ.get("CDK_DEPLOY_REGION")
)
print(deploy_env)
## Define Deployment Stacks
from stacks.network import NetworkStack
from stacks.rds_postgres import RdsPostgresStack
app = cdk.App()
env_name = os.getenv("ENVIRONMENT")
vpc_stack = NetworkStack(
scope = app,
id = '{0}-network-stack'.format(env_name),
env = deploy_env
)
rds_stack = RdsPostgresStack(
scope = app,
id = '{0}-rds-postgres-stack'.format(env_name),
vpc = vpc_stack.vpc,
env = deploy_env
)
app.synth()