-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdk_stacks.py
32 lines (28 loc) · 855 Bytes
/
cdk_stacks.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
from aws_cdk import (
App,
Environment,
)
from pathlib import Path
from os import path
import json
from stacks.backend_stack import BackendStack
################### ENVIRONMENT VARIABLES ###################
aws_account_id = ""
aws_region = ""
config_file = Path(__file__).absolute().parent.__str__() + "/config.json"
################### END ENVIRONMENT VARIABLES ###################
if path.isfile(config_file) is False:
raise Exception("File not found")
with open(config_file, "r") as config:
config = json.load(config)
aws_account_id = config["aws_account_id"]
aws_region = config["aws_region"]
if aws_account_id != "" and aws_region != "":
app = App()
env = Environment(account=aws_account_id, region=aws_region)
BackendStack(
app,
"SummarizeMyDoc-Backend",
env=env
)
app.synth()