-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
34 lines (24 loc) · 855 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
#!/usr/bin/env python3
import os
import json
from aws_cdk import core
from compute_notifier.compute_notifier_stack import ComputeNotifierStack
def load_aux_config(environment: str):
aux_config_file = os.path.expanduser(f'./aux_config/{environment}.json')
if not os.path.isfile(aux_config_file):
return None
with open(aux_config_file) as f:
try:
config = json.load(f)
except Exception as e:
print('Not able to load aux config file {} : {}'.format(aux_config_file, e))
return None
return config
deploy_env = os.getenv('DEPLOY_ENVIRONMENT', 'dev')
aux_config = load_aux_config(deploy_env)
app = core.App()
ComputeNotifierStack(app,
"computeNotifier",
deploy_env=deploy_env,
aux_config=aux_config)
app.synth()