cdk-sns-notify
Project description
cdk-sns-notify
A CDK construct library to send line notify or discord webhook
Sample
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_sns as sns
import aws_cdk.aws_cloudwatch as cloudwatch
import aws_cdk.aws_cloudwatch_actions as cw_actions
from cdk_sns_notify import SnsNotify
topic = sns.Topic(stack, "Topic")
metric = cloudwatch.Metric(
namespace="AWS/EC2",
metric_name="CPUUtilization",
dimensions={
"InstanceId": instance.instance_id
},
period=cdk.Duration.minutes(1)
)
alarm = cloudwatch.Alarm(stack, "Alarm",
metric=metric,
threshold=5,
evaluation_periods=1
)
alarm.add_alarm_action(cw_actions.SnsAction(topic))
sns_line_notify = SnsNotify(stack, "sns-line-notify",
line_notify_token="lineNotifyToken"
)
topic.add_subscription(sns_line_notify.lambda_subscription)
Deploy
cdk deploy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk-sns-notify-0.0.99.tar.gz
(25.1 kB
view hashes)
Built Distribution
Close
Hashes for cdk_sns_notify-0.0.99-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d43ce6d300cf4d99ec538bea2c205a99ad6a11ab157c95448a122d815f0b1bf5 |
|
MD5 | ee0534921b9b3b0ce1e399318f8f76d2 |
|
BLAKE2b-256 | ef20ebc3bda2ceb153aec3b10bc0f6df78732a0812914aa6c5d27ee0d618db6e |