-
Notifications
You must be signed in to change notification settings - Fork 10
/
app.py
84 lines (77 loc) · 2.84 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
from aws_cdk import App, Environment, Aspects
from nitro_wallet.nitro_wallet_stack import NitroWalletStack
from nitro_wallet.nitro_wireguard_stack import NitroWireguardStack
from nitro_wallet.nitro_socat_stack import NitroSocatStack
from nitro_wallet.nitro_rds_integration_stack import NitroRdsIntegrationStack
from nitro_wallet.nitro_https_web_server_stack import NitroHttpsWebServerStack
from nitro_wallet.nitro_dotnet_sqs_integration_stack import NitroDotnetSqsIntegrationStack
import cdk_nag
prefix = os.getenv("CDK_PREFIX", "dev")
application_type = os.getenv("CDK_APPLICATION_TYPE", "eth1")
app = App()
if application_type == "eth1":
NitroWalletStack(
app,
f"{prefix}NitroWalletEth",
params={"deployment": "dev", "application_type": application_type},
env=Environment(
region=os.environ.get("CDK_DEPLOY_REGION"),
account=os.environ.get("CDK_DEPLOY_ACCOUNT")
),
)
elif application_type == "wireguard":
NitroWireguardStack(
app,
f"{prefix}NitroWireguard",
params={"deployment": "dev", "application_type": application_type},
env=Environment(
region=os.environ.get("CDK_DEPLOY_REGION"),
account=os.environ.get("CDK_DEPLOY_ACCOUNT")
),
)
elif application_type == "socat":
NitroSocatStack(
app,
f"{prefix}NitroSocat",
params={"deployment": "dev", "application_type": application_type},
env=Environment(
region=os.environ.get("CDK_DEPLOY_REGION"),
account=os.environ.get("CDK_DEPLOY_ACCOUNT")
),
)
elif application_type == "rds_integration":
NitroRdsIntegrationStack(
app,
f"{prefix}NitroRdsIntegration",
params={"deployment": "dev", "application_type": application_type},
env=Environment(
region=os.environ.get("CDK_DEPLOY_REGION"),
account=os.environ.get("CDK_DEPLOY_ACCOUNT")
),
)
elif application_type == "https_web_server":
NitroHttpsWebServerStack(
app,
f"{prefix}NitroHttpsWebServer",
params={"deployment": "dev", "application_type": application_type},
env=Environment(
region=os.environ.get("CDK_DEPLOY_REGION"),
account=os.environ.get("CDK_DEPLOY_ACCOUNT")
),
)
elif application_type == "dotnet_sqs_integration":
NitroDotnetSqsIntegrationStack(
app,
f"{prefix}NitroDotnetSqsIntegration",
params={"deployment": "dev", "application_type": application_type},
env=Environment(
region=os.environ.get("CDK_DEPLOY_REGION"),
account=os.environ.get("CDK_DEPLOY_ACCOUNT")
),
)
Aspects.of(app).add(cdk_nag.AwsSolutionsChecks())
app.synth()