this is a lambda function for sending slack message at any chanel.
##usage
- create empty node v6.10.3 lambda function named codeDeploySlackWebhook.
- authorize aws cli.
- run
$ source zipandload.sh
it will create codeDeploySlackWebhook.zip and deploy the function. - you can use aither codepipline parameters or lambda env vars.
- codepipline user paramters usage:
- edit satge at code deploy. under aws lambda function name, input at the user paremetrs input this kind of json:
{ "message" : "some slack message", "url" : "the webapp endpoint url", "channel" : "#slack channel" "slackwebhook" : "the webhook ul" }
- edit satge at code deploy. under aws lambda function name, input at the user paremetrs input this kind of json:
- lambda env veribals to set details:
- MESSAGE = slack message
- URL = the link to attach at the end of the message.
- CHANNEL = #slack channel
- SLACKWEBHOOKURL = slack webhook url as provided https://YOURGROUP.slack.com/apps/manage/custom-integrations
- the notification displayed next to screaming cat icon.
- don't forget to attach aws role the lambda:ListFunctions premmision.
##develop
- run
nvm use
in case you using nvm. - this is important because only specific node versions are allowed at lambda. - you can test function localy on index_ex.js
- index.js is wrapped with lambda handler.
- rebuild zip and upload it to lambda by the name "codeDeploySlackWebhook" by running
$source zipandload.sh