Skip to main content

cdk-sns-notify

Project description

NPM version PyPI version Release

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.100.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_sns_notify-0.0.100-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file cdk-sns-notify-0.0.100.tar.gz.

File metadata

  • Download URL: cdk-sns-notify-0.0.100.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

Hashes for cdk-sns-notify-0.0.100.tar.gz
Algorithm Hash digest
SHA256 7dc4c821af7fbf2d7d45f1b3d66bcc51233297a3fd213586bb203cce3b04322a
MD5 aa384a01cb7e2bd45c8a342c84478cb0
BLAKE2b-256 934f24e5ab65d5921a2b78ff0b758c645f7b0ffe5fabc5c905ef29bc865650ff

See more details on using hashes here.

File details

Details for the file cdk_sns_notify-0.0.100-py3-none-any.whl.

File metadata

  • Download URL: cdk_sns_notify-0.0.100-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

Hashes for cdk_sns_notify-0.0.100-py3-none-any.whl
Algorithm Hash digest
SHA256 592df0561ac93ca91a9ab28fa7bab0b23db95ccf5e862dabc55faccfc1085972
MD5 4f6c6e664b376030c47d53a5873e4fd6
BLAKE2b-256 76b5d8867a979ab5120fa2d778d577671a6e9e6ce10163e6bd3c9937e4d64966

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page