cdk-sns-notify


Namecdk-sns-notify JSON
Version 0.0.242 PyPI version JSON
download
home_pagehttps://github.com/clarencetw/cdk-sns-notify.git
Summarycdk-sns-notify
upload_time2022-07-03 01:11:45
maintainer
docs_urlNone
authorClarence<mr.lin.clarence@gmail.com>
requires_python~=3.7
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": "",
    "docs_url": null,
    "requires_python": "~=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Clarence<mr.lin.clarence@gmail.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/3f/f2/d057ccf17e2892d6e358e7a37fdb76e2b1539d0ead88737d672f10cd2f81/cdk-sns-notify-0.0.242.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\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "cdk-sns-notify",
    "version": "0.0.242",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "953816de1aa572fe6bcd96df79b7596e",
                "sha256": "4516651c1d4cdc706abb9bd8115b5208a636045d88a54b485968ad86ac81caa0"
            },
            "downloads": -1,
            "filename": "cdk_sns_notify-0.0.242-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "953816de1aa572fe6bcd96df79b7596e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.7",
            "size": 25066,
            "upload_time": "2022-07-03T01:11:42",
            "upload_time_iso_8601": "2022-07-03T01:11:42.877334Z",
            "url": "https://files.pythonhosted.org/packages/65/21/bb6aaf192657e8f9c2c20720a49eca21e167780b4f41af96b0d0f0b8c838/cdk_sns_notify-0.0.242-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "902c7825ceae8a348891fb038dd6fbaf",
                "sha256": "0e9e6402ed1c68f0fe3ce267987f4a41f369d8205623c1ad10a5c0a2d1501ddf"
            },
            "downloads": -1,
            "filename": "cdk-sns-notify-0.0.242.tar.gz",
            "has_sig": false,
            "md5_digest": "902c7825ceae8a348891fb038dd6fbaf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.7",
            "size": 25786,
            "upload_time": "2022-07-03T01:11:45",
            "upload_time_iso_8601": "2022-07-03T01:11:45.100037Z",
            "url": "https://files.pythonhosted.org/packages/3f/f2/d057ccf17e2892d6e358e7a37fdb76e2b1539d0ead88737d672f10cd2f81/cdk-sns-notify-0.0.242.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-07-03 01:11:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "clarencetw",
    "github_project": "cdk-sns-notify.git",
    "lcname": "cdk-sns-notify"
}
        
Elapsed time: 0.48248s