cdk-sns-notify


Namecdk-sns-notify JSON
Version 0.0.948 PyPI version JSON
download
home_pagehttps://github.com/clarencetw/cdk-sns-notify.git
Summarycdk-sns-notify
upload_time2024-09-02 01:00:17
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/0b/0a/451223fedef66cd675c51bfbbdd3a08e4cefce9b93c0278eced01622a7b1/cdk_sns_notify-0.0.948.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.948",
    "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": "d31a1230388cf816685c29b16196e51b9bfa3458d861bd18c751e134ab8a7365",
                "md5": "9ddeaadcb90d74a06b9672bcaa3130ce",
                "sha256": "70920e50b7c287e2cc119efd5cfb250a90221e538d7dd539b1f6da08503fdcf0"
            },
            "downloads": -1,
            "filename": "cdk_sns_notify-0.0.948-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ddeaadcb90d74a06b9672bcaa3130ce",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 26311,
            "upload_time": "2024-09-02T01:00:14",
            "upload_time_iso_8601": "2024-09-02T01:00:14.868869Z",
            "url": "https://files.pythonhosted.org/packages/d3/1a/1230388cf816685c29b16196e51b9bfa3458d861bd18c751e134ab8a7365/cdk_sns_notify-0.0.948-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b0a451223fedef66cd675c51bfbbdd3a08e4cefce9b93c0278eced01622a7b1",
                "md5": "c43ecfb1796f45e411c435a5b11b7a8b",
                "sha256": "34951e13e1cb82e78ade2c87c0505eedd4d9b91b5956afc7dfe76ce5c8142dc1"
            },
            "downloads": -1,
            "filename": "cdk_sns_notify-0.0.948.tar.gz",
            "has_sig": false,
            "md5_digest": "c43ecfb1796f45e411c435a5b11b7a8b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 27508,
            "upload_time": "2024-09-02T01:00:17",
            "upload_time_iso_8601": "2024-09-02T01:00:17.299648Z",
            "url": "https://files.pythonhosted.org/packages/0b/0a/451223fedef66cd675c51bfbbdd3a08e4cefce9b93c0278eced01622a7b1/cdk_sns_notify-0.0.948.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-02 01:00:17",
    "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.28125s