-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
43 lines (32 loc) · 1.13 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
#!/usr/bin/env python3
""" CDK Configuration for the nasa-analytics stack."""
import os
from aws_cdk import App, Stack, Tags, DefaultStackSynthesizer
from constructs import Construct
from cdk.cluster.construct import ClusterConstruct
from cdk.iam.construct import IamConstruct
from config import Settings
config = Settings()
app = App()
cdk_tags = {
"Project": config.project_tag,
"Stack": config.stack_tag,
"Client": config.client_tag,
"Owner": config.owner_tag,
}
class AnalyticsStack(Stack):
"""CDK stack for the nasa-analytics stack."""
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
"""."""
super().__init__(scope, construct_id, **kwargs)
analytics_stack = AnalyticsStack(
app,
f"analytics-stack-{config.qualifier}",
synthesizer=DefaultStackSynthesizer(qualifier=config.qualifier)
)
cluster = ClusterConstruct(analytics_stack, "cluster", qualifier=config.qualifier, cdk_tags=cdk_tags)
iam = IamConstruct(analytics_stack, "iam", qualifier=config.qualifier)
for key, value in cdk_tags.items():
if value:
Tags.of(app).add(key=key, value=value)
app.synth()