Skip to content

Commit 600aa93

Browse files
committed
Added cdk-watchful and monitoring email address
1 parent 1e8a20f commit 600aa93

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

api_gw/api_gw_stack.py

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from aws_cdk.aws_sns import Topic, SubscriptionFilter
1414
from aws_cdk.aws_sns_subscriptions import SqsSubscription
1515
from aws_cdk.aws_sqs import Queue
16+
from cdk_watchful import Watchful
1617
from constructs import Construct
1718

1819

@@ -25,6 +26,12 @@ def __init__(self, scope: Construct, id: str, props, **kwargs) -> None:
2526
# Tag everything
2627
Tags.of(self).add("project", props["namespace"])
2728

29+
###
30+
# Monitor everything
31+
# Learn more: https://github.com/cdklabs/cdk-watchful
32+
wf = Watchful(self, "Watchful", alarm_email=props["alarm_email"])
33+
wf.watch_scope(self)
34+
2835
###
2936
# SNS Topic Creation
3037
# Our API Gateway posts messages directly to this

app.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#!/usr/bin/env python3
22

33
from aws_cdk import App
4-
54
from api_gw.api_gw_stack import APIGWStack
65

6+
77
app = App()
88
props = {
99
"namespace": app.node.try_get_context("namespace"),
1010
"hosted_zone_id": app.node.try_get_context("hosted_zone_id"),
1111
"hosted_zone_name": app.node.try_get_context("hosted_zone_name"),
1212
"cert_arn": app.node.try_get_context("cert_arn"),
13-
"custom_domain_name": app.node.try_get_context("custom_domain_name")
13+
"custom_domain_name": app.node.try_get_context("custom_domain_name"),
14+
"alarm_email": app.node.try_get_context("alarm_email")
1415
}
1516
APIGWStack(app, "ApiGatewayFanOut", props=props)
1617

cdk.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"hosted_zone_id": "ZZ4353459fghEXAMPLE",
66
"hosted_zone_name": "example.com",
77
"cert_arn": "arn:aws:acm:us-east-?:replaceme:certificate/bf155d92-d49sdfg4353b2db396c1182",
8-
"custom_domain_name": "api.example.com"
8+
"custom_domain_name": "api.example.com",
9+
"alarm_email": "example@me.com"
910
}
1011
}

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
aws-cdk-lib>=2.0.0
22
constructs>=10.0.0
3+
cdk-watchful

0 commit comments

Comments
 (0)