-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.py
71 lines (57 loc) · 2.23 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
64
65
66
67
68
69
70
71
#!/usr/bin/env python3
from aws_cdk import core as cdk
from stacks.back_end.vpc_stack import VpcStack
from stacks.back_end.s3_stack.s3_stack import S3Stack
from stacks.back_end.eks_cluster_stack.eks_cluster_stack import EksClusterStack
from stacks.back_end.eks_sqs_producer_stack.eks_sqs_producer_stack import EksSqsProducerStack
from stacks.back_end.eks_sqs_consumer_stack.eks_sqs_consumer_stack import EksSqsConsumerStack
app = cdk.App()
# S3 Bucket to hold our sales events
sales_events_bkt_stack = S3Stack(
app,
# f"{app.node.try_get_context('project')}-sales-events-bkt-stack",
f"sales-events-bkt-stack",
stack_log_level="INFO",
description="Miztiik Automation: S3 Bucket to hold our sales events"
)
# VPC Stack for hosting Secure workloads & Other resources
vpc_stack = VpcStack(
app,
# f"{app.node.try_get_context('project')}-vpc-stack",
"eks-cluster-vpc-stack",
stack_log_level="INFO",
description="Miztiik Automation: Custom Multi-AZ VPC"
)
# EKS Cluster to process event processor
eks_cluster_stack = EksClusterStack(
app,
f"eks-cluster-stack",
stack_log_level="INFO",
vpc=vpc_stack.vpc,
description="Miztiik Automation: EKS Cluster to process event processor"
)
# Produce sales event on EKS Pods and ingest to SQS queue
sales_events_producer_stack = EksSqsProducerStack(
app,
f"sales-events-producer-stack",
stack_log_level="INFO",
eks_cluster=eks_cluster_stack.eks_cluster_1,
sales_event_bkt=sales_events_bkt_stack.data_bkt,
description="Miztiik Automation: Produce sales event on EKS Pods and ingest to SQS queue")
# Consumer to process sales events from SQS
sales_events_consumer_stack = EksSqsConsumerStack(
app,
f"sales-events-consumer-stack",
stack_log_level="INFO",
eks_cluster=eks_cluster_stack.eks_cluster_1,
reliable_q=sales_events_producer_stack.reliable_q,
sales_event_bkt=sales_events_bkt_stack.data_bkt,
description="Miztiik Automation: Consumer to process sales events from SQS")
# Stack Level Tagging
_tags_lst = app.node.try_get_context("tags")
if _tags_lst:
for _t in _tags_lst:
for k, v in _t.items():
cdk.Tags.of(app).add(
k, v, apply_to_launched_instances=True, priority=300)
app.synth()