cdk-sns-notify


Namecdk-sns-notify JSON
Version 0.0.887 PyPI version JSON
download
home_pagehttps://github.com/clarencetw/cdk-sns-notify.git
Summarycdk-sns-notify
upload_time2024-06-20 00:51:58
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/9d/6e/fab9a13d029298a1ebc4db4fc6b5597bfd722d1dfd2274ca1c08aeba4b5c/cdk-sns-notify-0.0.887.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.887",
    "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": "01854627e252a8d4c8e6c3e1ef1bb9c3b451e92cd54c36da81c403732611d042",
                "md5": "c0c93eabae02bad71f8e9158e33eba93",
                "sha256": "e13a94b39264cf6b9ecde66d72c1292f471df925bd5a26786220c879df565f27"
            },
            "downloads": -1,
            "filename": "cdk_sns_notify-0.0.887-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c0c93eabae02bad71f8e9158e33eba93",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 25236,
            "upload_time": "2024-06-20T00:51:48",
            "upload_time_iso_8601": "2024-06-20T00:51:48.592502Z",
            "url": "https://files.pythonhosted.org/packages/01/85/4627e252a8d4c8e6c3e1ef1bb9c3b451e92cd54c36da81c403732611d042/cdk_sns_notify-0.0.887-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d6efab9a13d029298a1ebc4db4fc6b5597bfd722d1dfd2274ca1c08aeba4b5c",
                "md5": "514f41526bb6525bbc02d4553c95f6ae",
                "sha256": "bead188212e720cb9e166826c99f0d32efdb733c7577b62018611a2dedfc85db"
            },
            "downloads": -1,
            "filename": "cdk-sns-notify-0.0.887.tar.gz",
            "has_sig": false,
            "md5_digest": "514f41526bb6525bbc02d4553c95f6ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 26569,
            "upload_time": "2024-06-20T00:51:58",
            "upload_time_iso_8601": "2024-06-20T00:51:58.462070Z",
            "url": "https://files.pythonhosted.org/packages/9d/6e/fab9a13d029298a1ebc4db4fc6b5597bfd722d1dfd2274ca1c08aeba4b5c/cdk-sns-notify-0.0.887.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-20 00:51:58",
    "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.27208s