-
Notifications
You must be signed in to change notification settings - Fork 1
/
app_account.py
111 lines (90 loc) · 4.07 KB
/
app_account.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python3
import aws_cdk as cdk
from importlib import import_module
from src.account.stacks.account_common_stack import DataZoneConnectorsAccountCommonStack
from src.producer.stacks.producer_common_stack import DataZoneConnectorsProducerCommonStack
from src.producer.stacks.producer_workflows_stack import ProducerWorkflowsStack
from src.producer.stacks.producer_service_portfolio_stack import ProducerServicePortfolioStack
from src.consumer.stacks.consumer_workflows_stack import ConsumerWorkflowsStack
from src.consumer.stacks.consumer_service_portfolio_stack import ConsumerServicePortfolioStack
app = cdk.App()
account = cdk.Aws.ACCOUNT_ID
region = cdk.Aws.REGION
env = cdk.Environment(
account= account,
region= region
)
context_account_id = app.node.try_get_context("account")
account_config_module = import_module(f'config.account.a_{context_account_id}_config')
ACCOUNT_PROPS = getattr(account_config_module, 'ACCOUNT_PROPS')
PRODUCER_PROPS = getattr(account_config_module, 'PRODUCER_PROPS')
PRODUCER_WORKFLOW_PROPS = getattr(account_config_module, 'PRODUCER_WORKFLOW_PROPS')
PRODUCER_SERVICE_PORTFOLIO_PROPS = getattr(account_config_module, 'PRODUCER_SERVICE_PORTFOLIO_PROPS')
CONSUMER_WORKFLOW_PROPS = getattr(account_config_module, 'CONSUMER_WORKFLOW_PROPS')
CONSUMER_SERVICE_PORTFOLIO_PROPS = getattr(account_config_module, 'CONSUMER_SERVICE_PORTFOLIO_PROPS')
# ---------------- Account Stacks ------------------------
account_common_constructs = {}
dz_conn_a_common_stack = DataZoneConnectorsAccountCommonStack(
scope= app,
construct_id = "dz-conn-a-common-stack",
account_props = ACCOUNT_PROPS,
env = env,
description= "Guidance for Connecting Data Products with Amazon DataZone - Account Common Stack - (SO9317)"
)
account_common_constructs = {
**account_common_constructs,
**dz_conn_a_common_stack.outputs
}
# ---------------- Producer Stacks ------------------------
dz_conn_p_common_stack = DataZoneConnectorsProducerCommonStack(
scope= app,
construct_id = "dz-conn-p-common-stack",
account_props = ACCOUNT_PROPS,
producer_props = PRODUCER_PROPS,
common_constructs = account_common_constructs,
env = env,
description= "Guidance for Connecting Data Products with Amazon DataZone - Producer Common Stack - (SO9317)"
)
dz_conn_p_common_stack.node.add_dependency(dz_conn_a_common_stack)
account_common_constructs = {
**account_common_constructs,
**dz_conn_p_common_stack.outputs
}
dz_conn_p_workflows_stack = ProducerWorkflowsStack(
scope= app,
construct_id = "dz-conn-p-workflows-stack",
account_props = ACCOUNT_PROPS,
workflows_props = PRODUCER_WORKFLOW_PROPS,
common_constructs = account_common_constructs,
env = env,
description= "Guidance for Connecting Data Products with Amazon DataZone - Producer Workflows Stack - (SO9317)"
)
dz_conn_p_service_portfolio_stack = ProducerServicePortfolioStack(
scope= app,
construct_id = "dz-conn-p-service-portfolio-stack",
account_props = ACCOUNT_PROPS,
portfolio_props = PRODUCER_SERVICE_PORTFOLIO_PROPS,
common_constructs = account_common_constructs,
env = env,
description= "Guidance for Connecting Data Products with Amazon DataZone - Producer Portfolio Stack - (SO9317)"
)
# ---------------- Consumer Stacks ------------------------
dz_conn_c_workflows_stack = ConsumerWorkflowsStack(
scope= app,
construct_id = "dz-conn-c-workflows-stack",
account_props = ACCOUNT_PROPS,
workflows_props = CONSUMER_WORKFLOW_PROPS,
common_constructs = account_common_constructs,
env = env,
description= "Guidance for Connecting Data Products with Amazon DataZone - Consumer Workflows Stack - (SO9317)"
)
dz_conn_c_service_portfolio_stack = ConsumerServicePortfolioStack(
scope= app,
construct_id = "dz-conn-c-service-portfolio-stack",
account_props = ACCOUNT_PROPS,
portfolio_props = CONSUMER_SERVICE_PORTFOLIO_PROPS,
common_constructs = account_common_constructs,
env = env,
description= "Guidance for Connecting Data Products with Amazon DataZone - Consumer Portfolio Stack - (SO9317)"
)
app.synth()