-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
46 lines (35 loc) · 987 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
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
import os
import aws_cdk as cdk
from cdk_stacks import (
VpcStack,
MskStack,
KafkaClientEC2InstanceStack,
RedshiftServerlessStack
)
AWS_ENV = cdk.Environment(account=os.getenv('CDK_DEFAULT_ACCOUNT'),
region=os.getenv('CDK_DEFAULT_REGION'))
app = cdk.App()
vpc_stack = VpcStack(app, 'MskToRedshiftVpc',
env=AWS_ENV)
msk_stack = MskStack(app, 'MskToRedshiftServerless',
vpc_stack.vpc,
env=AWS_ENV
)
msk_stack.add_dependency(vpc_stack)
redshift_stack = RedshiftServerlessStack(app, 'RedshiftStreamingIngestionFromMSK',
vpc_stack.vpc,
msk_stack.sg_msk_client,
env=AWS_ENV
)
redshift_stack.add_dependency(msk_stack)
kafka_client_ec2_stack = KafkaClientEC2InstanceStack(app, 'KafkaClientEC2InstanceStack',
vpc_stack.vpc,
msk_stack.sg_msk_client,
msk_stack.msk_cluster_name,
env=AWS_ENV
)
kafka_client_ec2_stack.add_dependency(msk_stack)
app.synth()