cdk-sns-notify
Project description
cdk-sns-notify
A CDK construct library to send line notify or discord webhook
Sample
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
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"
)
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.30.tar.gz
(24.8 kB
view hashes)
Built Distribution
Close
Hashes for cdk_sns_notify-0.0.30-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee7dd9b661c7b840cf9e1bd22e596915115b4dd56ee8a6ad91db1f47abe3076f |
|
MD5 | a0ed09783ece7e9f571b2b727225ed74 |
|
BLAKE2b-256 | 08015a2127c14c32fcec387a311f5efe8fc952bfe7ebbcc5e8201527e716fc26 |