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"
)
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.49.tar.gz
(25.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cdk-sns-notify-0.0.49.tar.gz.
File metadata
- Download URL: cdk-sns-notify-0.0.49.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd5c7347858e2032f04f439c30d6db3efa490c36652e099fa2c6503d2089583d
|
|
| MD5 |
03791e8893dfd3ac900e444be1138576
|
|
| BLAKE2b-256 |
1d452ebee489ef4808863a1c02a393904c707274cd043a2bcc830c37a17d7e07
|
File details
Details for the file cdk_sns_notify-0.0.49-py3-none-any.whl.
File metadata
- Download URL: cdk_sns_notify-0.0.49-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fb3ac475dd5d419efc96a62aaaff5cc99093235753a0dc15b75902144812e62
|
|
| MD5 |
70cc1b5879caa17860e939be81a8a279
|
|
| BLAKE2b-256 |
d27cc3c884b1337a4c955b0a832844b732a9ebe475a6e4cdae0e382ce138399d
|