cdk-sns-notify


Namecdk-sns-notify JSON
Version 0.0.917 PyPI version JSON
download
home_pagehttps://github.com/clarencetw/cdk-sns-notify.git
Summarycdk-sns-notify
upload_time2024-07-27 00:55:22
maintainerNone
docs_urlNone
authorClarence<mr.lin.clarence@gmail.com>
requires_python~=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![NPM version](https://badge.fury.io/js/cdk-sns-notify.svg)](https://badge.fury.io/js/cdk-sns-notify)
[![PyPI version](https://badge.fury.io/py/cdk-sns-notify.svg)](https://badge.fury.io/py/cdk-sns-notify)
![Release](https://github.com/clarencetw/cdk-sns-notify/workflows/Release/badge.svg)

# cdk-sns-notify

A CDK construct library to send line notify or discord webhook

# Sample

```python
import * as sns from "@aws-cdk/aws-sns";
import * as cloudwatch from "@aws-cdk/aws-cloudwatch";
import * as cw_actions from "@aws-cdk/aws-cloudwatch-actions";

import { SnsNotify } from "cdk-sns-notify";

const topic = new sns.Topic(stack, "Topic");

const metric = new cloudwatch.Metric({
  namespace: "AWS/EC2",
  metricName: "CPUUtilization",
  dimensions: {
    InstanceId: instance.instanceId,
  },
  period: cdk.Duration.minutes(1),
});

const alarm = new cloudwatch.Alarm(stack, "Alarm", {
  metric,
  threshold: 5,
  evaluationPeriods: 1,
});

alarm.addAlarmAction(new cw_actions.SnsAction(topic));

const snsLineNotify = new SnsNotify(stack, "sns-line-notify", {
  lineNotifyToken: "lineNotifyToken",
});

topic.addSubscription(snsLineNotify.lambdaSubscription);
```

# Deploy

```sh
cdk deploy
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clarencetw/cdk-sns-notify.git",
    "name": "cdk-sns-notify",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Clarence<mr.lin.clarence@gmail.com>",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/63/79/8c4191eb9efa7afe73795869d616dac974e5aef44de06f058e1002ed77c6/cdk-sns-notify-0.0.917.tar.gz",
    "platform": null,
    "description": "[![NPM version](https://badge.fury.io/js/cdk-sns-notify.svg)](https://badge.fury.io/js/cdk-sns-notify)\n[![PyPI version](https://badge.fury.io/py/cdk-sns-notify.svg)](https://badge.fury.io/py/cdk-sns-notify)\n![Release](https://github.com/clarencetw/cdk-sns-notify/workflows/Release/badge.svg)\n\n# cdk-sns-notify\n\nA CDK construct library to send line notify or discord webhook\n\n# Sample\n\n```python\nimport * as sns from \"@aws-cdk/aws-sns\";\nimport * as cloudwatch from \"@aws-cdk/aws-cloudwatch\";\nimport * as cw_actions from \"@aws-cdk/aws-cloudwatch-actions\";\n\nimport { SnsNotify } from \"cdk-sns-notify\";\n\nconst topic = new sns.Topic(stack, \"Topic\");\n\nconst metric = new cloudwatch.Metric({\n  namespace: \"AWS/EC2\",\n  metricName: \"CPUUtilization\",\n  dimensions: {\n    InstanceId: instance.instanceId,\n  },\n  period: cdk.Duration.minutes(1),\n});\n\nconst alarm = new cloudwatch.Alarm(stack, \"Alarm\", {\n  metric,\n  threshold: 5,\n  evaluationPeriods: 1,\n});\n\nalarm.addAlarmAction(new cw_actions.SnsAction(topic));\n\nconst snsLineNotify = new SnsNotify(stack, \"sns-line-notify\", {\n  lineNotifyToken: \"lineNotifyToken\",\n});\n\ntopic.addSubscription(snsLineNotify.lambdaSubscription);\n```\n\n# Deploy\n\n```sh\ncdk deploy\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "cdk-sns-notify",
    "version": "0.0.917",
    "project_urls": {
        "Homepage": "https://github.com/clarencetw/cdk-sns-notify.git",
        "Source": "https://github.com/clarencetw/cdk-sns-notify.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5907b37903145a2584480a091c7fa9d3cbe879a4b7ca3836b91c4d287683e319",
                "md5": "ba867c66730272a78a90244a0bdd6796",
                "sha256": "017fa035759c630e37a92f9ed8f000fd8a9674cb0ff443995028ce03f3240553"
            },
            "downloads": -1,
            "filename": "cdk_sns_notify-0.0.917-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba867c66730272a78a90244a0bdd6796",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 25226,
            "upload_time": "2024-07-27T00:55:17",
            "upload_time_iso_8601": "2024-07-27T00:55:17.706180Z",
            "url": "https://files.pythonhosted.org/packages/59/07/b37903145a2584480a091c7fa9d3cbe879a4b7ca3836b91c4d287683e319/cdk_sns_notify-0.0.917-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "63798c4191eb9efa7afe73795869d616dac974e5aef44de06f058e1002ed77c6",
                "md5": "7ba0b2c1c55a18c50649b99ba4ffdec1",
                "sha256": "adfd372ab843242e60bbb635fd5979181a8a328e7d61d44386c9ee8fad15c1da"
            },
            "downloads": -1,
            "filename": "cdk-sns-notify-0.0.917.tar.gz",
            "has_sig": false,
            "md5_digest": "7ba0b2c1c55a18c50649b99ba4ffdec1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 26538,
            "upload_time": "2024-07-27T00:55:22",
            "upload_time_iso_8601": "2024-07-27T00:55:22.007390Z",
            "url": "https://files.pythonhosted.org/packages/63/79/8c4191eb9efa7afe73795869d616dac974e5aef44de06f058e1002ed77c6/cdk-sns-notify-0.0.917.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-27 00:55:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clarencetw",
    "github_project": "cdk-sns-notify",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cdk-sns-notify"
}
        
Elapsed time: 0.38505s