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.101.tar.gz
(25.1 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.101.tar.gz.
File metadata
- Download URL: cdk-sns-notify-0.0.101.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.6.4 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dcf936a54156d39ab2a5b5ea1c1f171a7d8dbc534a714371e3d4de9aa74b4c6
|
|
| MD5 |
4ddb42abe56eb29edd38a10d325c0ade
|
|
| BLAKE2b-256 |
3d377ffbed5fd8f1dc40be7d6700c04bbc1c919bdb252f8bd34539193cd02cc1
|
File details
Details for the file cdk_sns_notify-0.0.101-py3-none-any.whl.
File metadata
- Download URL: cdk_sns_notify-0.0.101-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.6.4 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bbe2908711d9f727698db1747ad482ab2e2da4148b1f518b95f16a43123e9b8
|
|
| MD5 |
77cad3dfa2b13fa4c374e19bf02134ad
|
|
| BLAKE2b-256 |
d4340d9a791e44aefcffe0fd9e91b178989042e87ffc8862daf1412db2a16ee7
|