Based on aws-to-slack.
This AWS lambda function processes the following AWS events from Amazon SNS and forwards them to a Slack App webhook.
- Cloudwatch Alarms
Environment Variable | Description | Required |
---|---|---|
SLACK_WEBHOOK_CICD | The webhook URL for the announce-cicd channel in your Slack app. | Yes |
SLACK_WEBHOOK_INCIDENTS | The webhook URL for the announce-incidents channel in you Slack app. | Yes |
ASSUME_ROLE_NAME | The name of the role which is assumed to retrieve metric data from other AWS accounts. The role must allow cloudwatch:GetMetricStatistics permissions. | No |
To build the lambda function run the following.
npm install
npm build
To run the tests.
npm test
The following will package the lambda function into a zip bundle to allow manual deployment.
npm run build
cd dist
zip -q -r lambda.zip ../node_modules .