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 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.46.tar.gz (25.0 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.46-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for cdk-sns-notify-0.0.46.tar.gz
Algorithm Hash digest
SHA256 0738e0076d91ab4e22831f9911553051fffbbb2adec58937536524e5e8d0a2c2
MD5 3e023dfbf0e15dcaaf80771d501f582a
BLAKE2b-256 389374dc8c389e16634d612bb41f616410eff0973c89f5c1d449212517c41d75

See more details on using hashes here.

File details

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

File metadata

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

Hashes for cdk_sns_notify-0.0.46-py3-none-any.whl
Algorithm Hash digest
SHA256 6c067e76715a7269b21b604dd792e88265a776c10a4491604ae90f65508ca333
MD5 a41aea9cef10ce74b0cf4dda425b752c
BLAKE2b-256 5f795390753ab3f7bd369f293c3b0a20a141ac29975516571a6dfd5d59e69b36

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