0.1.1 • Published 8 years ago
sns2slack v0.1.1
sns2slack
AWS SNS to slack notifications handler for AWS Lambda
Installation
Assuming you already have SNS topic with subscribed lambda...
Create node project and add dependency:
npm install sns2slackCreate
index.jsfile with following content:
const sns2slack = require("sns2slack");
exports.handler = sns2slack();Zip your project file and upload it to AWS Lambda.
Setup environment variables:
SLACK_URL- slack webhook integration urlSLACK_ENCRYPTED_URL- AWS KMS encrypted value ofSLACK_URLSLACK_CHANNEL- default slack channel name (you can override this value by map function)SLACK_USER_NAME- slack user name (default:AWS SNS)SLACK_USER_ICON- slack user icon (default::aws:)
Reference
sns2slack(options): lambda handler function
options:
map(snsMessage): optional function for transforming and filtering messages (return null to filter the log)