{"id":13624519,"url":"https://github.com/assertible/lambda-cloudwatch-slack","last_synced_at":"2025-04-16T00:32:34.483Z","repository":{"id":41432367,"uuid":"64170903","full_name":"assertible/lambda-cloudwatch-slack","owner":"assertible","description":"Send AWS CloudWatch notifications to a Slack channel using Lambda","archived":false,"fork":false,"pushed_at":"2023-06-20T17:47:34.000Z","size":688,"stargazers_count":473,"open_issues_count":38,"forks_count":246,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-29T00:25:49.594Z","etag":null,"topics":["aws-lambda","slack-notifications"],"latest_commit_sha":null,"homepage":"https://assertible.com/blog/npm-package-lambda-cloudwatch-slack","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/assertible.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-25T22:03:14.000Z","updated_at":"2024-05-14T21:51:04.000Z","dependencies_parsed_at":"2024-01-13T16:23:32.883Z","dependency_job_id":"a32b8669-b4c7-4d70-8d49-8d65c6f29648","html_url":"https://github.com/assertible/lambda-cloudwatch-slack","commit_stats":{"total_commits":58,"total_committers":13,"mean_commits":4.461538461538462,"dds":0.5517241379310345,"last_synced_commit":"90dca51f7e67882325601c1f7a62984937f3c92c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertible%2Flambda-cloudwatch-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertible%2Flambda-cloudwatch-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertible%2Flambda-cloudwatch-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assertible%2Flambda-cloudwatch-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assertible","download_url":"https://codeload.github.com/assertible/lambda-cloudwatch-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223691640,"owners_count":17186861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","slack-notifications"],"created_at":"2024-08-01T21:01:43.436Z","updated_at":"2024-11-08T13:30:38.393Z","avatar_url":"https://github.com/assertible.png","language":"JavaScript","readme":"# lambda-cloudwatch-slack\n\nAn [AWS Lambda](http://aws.amazon.com/lambda/) function for better Slack notifications. \n[Check out the blog post](https://assertible.com/blog/npm-package-lambda-cloudwatch-slack).\n\n[![BuildStatus](https://travis-ci.org/assertible/lambda-cloudwatch-slack.png?branch=master)](https://travis-ci.org/assertible/lambda-cloudwatch-slack)\n[![NPM version](https://badge.fury.io/js/lambda-cloudwatch-slack.png)](http://badge.fury.io/js/lambda-cloudwatch-slack)\n\n\n## Overview\n\nThis function was originally derived from the\n[AWS blueprint named `cloudwatch-alarm-to-slack`](https://aws.amazon.com/blogs/aws/new-slack-integration-blueprints-for-aws-lambda/). The\nfunction in this repo improves on the default blueprint in several\nways:\n\n**Better default formatting for CloudWatch notifications:**\n\n![AWS Cloud Notification for Slack](https://github.com/assertible/lambda-cloudwatch-slack/raw/master/images/cloudwatch.png)\n\n**Support for notifications from Elastic Beanstalk:**\n\n![Elastic Beanstalk Slack Notifications](https://github.com/assertible/lambda-cloudwatch-slack/raw/master/images/elastic-beanstalk.png)\n\n**Support for notifications from Code Deploy:**\n\n![AWS CodeDeploy Notifications](https://github.com/assertible/lambda-cloudwatch-slack/raw/master/images/code-deploy.png)\n\n**Basic support for notifications from ElastiCache:**\n\n![AWS ElastiCache Notifications](https://github.com/assertible/lambda-cloudwatch-slack/raw/master/images/elasticache.png)\n\n**Support for encrypted and unencrypted Slack webhook url:**\n\n\n## Configuration\n\n### 1. Clone this repository\n\n### 2. Configure environment variables\n\n```\ncp .env.example .env\n```\n\nFill in the variables in the `.env`. \n\n### 3. Setup Slack hook\n\nFollow these steps to configure the webhook in Slack:\n\n  1. Navigate to\n     [https://slack.com/services/new](https://slack.com/services/new)\n     and search for and select \"Incoming WebHooks\".\n\n  3. Choose the default channel where messages will be sent and click\n     \"Add Incoming WebHooks Integration\".\n\n  4. Copy the webhook URL from the setup instructions and use it in\n     the next section.\n\n  5. Click 'Save Settings' at the bottom of the Slack integration\n     page.\n\n#### Encrypted the Slack webhook URL\n\nIf you don't want or need to encrypt your hook URL, you can use the\n`UNENCRYPTED_HOOK_URL`.  If this variable is specified, the\n`KMS_ENCRYPTED_HOOK_URL` is ignored.\n\nIf you **do** want to encrypt your hook URL, follow these steps to\nencrypt your Slack hook URL for use in this function:\n\n  1. Create a KMS key -\n     http://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html.\n\n  2. Encrypt the event collector token using the AWS CLI.\n     $ aws kms encrypt --key-id alias/\u003cKMS key name\u003e --plaintext \"\u003cSLACK_HOOK_URL\u003e\"\n\n     Note: You must exclude the protocol from the URL\n     (e.g. \"hooks.slack.com/services/abc123\").\n\n  3. Copy the base-64 encoded, encrypted key (CiphertextBlob) to the\n     ENCRYPTED_HOOK_URL variable.\n\n  4. Give your function's role permission for the kms:Decrypt action.\n     Example:\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"Stmt1443036478000\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"kms:Decrypt\"\n            ],\n            \"Resource\": [\n                \"\u003cyour KMS key ARN\u003e\"\n            ]\n        }\n    ]\n}\n```\n\n\n### 4. Deploy to AWS Lambda\n\nThe final step is to deploy the integration to AWS Lambda:\n\n    npm install\n    npm run deploy\n\n## Tests\n\nWith the variables filled in, you can test the function:\n\n```\nnpm install\nnpm test\n```\n\n## License\n\nMIT License\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassertible%2Flambda-cloudwatch-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassertible%2Flambda-cloudwatch-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassertible%2Flambda-cloudwatch-slack/lists"}