-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
29 lines (22 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
#!/usr/bin/env python3
from aws_cdk import core
from cdksample.network_stack import NetworkStack
from cdksample.dynamodb_stack import DynamoDbStack
from cdksample.cluster_stack import ClusterStack
from cdksample.frontend_stack import FrontendStack
from cdksample.backend_stack import BackendStack
# スタック間のデータの受け渡しは以下を参考
# https://github.com/aws-samples/aws-cdk-examples/tree/master/python/codepipeline-docker-build
app = core.App()
props = dict()
prefix = app.node.try_get_context('stack_prefix')
props['prefix'] = prefix
env = core.Environment(
region=app.node.try_get_context('region')
)
vpc_stack = NetworkStack(app, '{}-NetworkStack'.format(prefix), env=env, props=props)
dynamodb_stack = DynamoDbStack(app, '{}-DynamoDbStack'.format(prefix), env=env, props=vpc_stack.outputs)
cluster_stack = ClusterStack(app, '{}-ClusterStack'.format(prefix), env=env, props=vpc_stack.outputs)
frontend_stack = FrontendStack(app, '{}-FrontendStack'.format(prefix), env=env, props=cluster_stack.outputs)
backend_stack = BackendStack(app, '{}-BackendStack'.format(prefix), env=env, props=frontend_stack.outputs)
app.synth()