-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
app.py
63 lines (52 loc) · 2.04 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
#!/usr/bin/env python3
from aws_cdk import core
from secure_private_api.stacks.back_end.vpc_stack import VpcStack
from secure_private_api.stacks.back_end.secure_private_api_stack import SecurePrivateApiStack
from secure_private_api.stacks.back_end.unsecure_public_api_stack import UnSecurePublicApiStack
from secure_private_api.stacks.back_end.api_consumer_stack import ApiConsumerStack
app = core.App()
# VPC Stack for hosting Secure API & Other resources
vpc_stack = VpcStack(
app, "secure-private-api-vpc-stack",
description="VPC Stack for hosting Secure API & Other resources"
)
# Deploy an unsecure public API
unsecure_public_api = UnSecurePublicApiStack(
app,
"unsecure-public-api",
stack_log_level="INFO",
back_end_api_name="unsecure_public_api_01",
description="Deploy an unsecure public API"
)
# Secure your API by create private EndPoint to make it accessible from your VPCs
secure_private_api = SecurePrivateApiStack(
app,
"secure-private-api",
vpc=vpc_stack.vpc,
stack_log_level="INFO",
back_end_api_name="secure_private_api_01",
description="Secure your API by create private EndPoint to make it accessible from your VPCs"
)
# Launch an EC2 Instance in a given VPC
api_consumer_stack = ApiConsumerStack(
app,
"api-consumer",
vpc=vpc_stack.vpc,
api_sec_grp=secure_private_api.secure_private_api_01_sec_grp,
stack_log_level="INFO",
description="Launch an EC2 Instance in a given VPC"
)
# Stack Level Tagging
core.Tag.add(app, key="Owner",
value=app.node.try_get_context('owner'))
core.Tag.add(app, key="OwnerProfile",
value=app.node.try_get_context('github_profile'))
core.Tag.add(app, key="GithubRepo",
value=app.node.try_get_context('github_repo_url'))
core.Tag.add(app, key="Udemy",
value=app.node.try_get_context('udemy_profile'))
core.Tag.add(app, key="SkillShare",
value=app.node.try_get_context('skill_profile'))
core.Tag.add(app, key="AboutMe",
value=app.node.try_get_context('about_me'))
app.synth()