AWS Notification Lambda
A simple lambda function to send a notification to Discord or Slack. Also works with SNS, in which case webhookUrl
and statusCode
would be MessageAttributes.
Discord
Deploy
create_function.sh notify_discord
Update
update_function.sh notify_discord
Usage
- Generate a basic execution lambda role and set the
ROLE_ARN
environment variable to it. - Generate a Discord webhook URL. Payload
webhookUrl
should correspond to the webhook URL to post the message to the right channel. - Assuming you have aws config and credentials set up, run
bash create_function.sh notify_discord
to deploy the function. - You can send a payload with 3 fields (
statusCode
,title
,body
) - IfstatusCode
(optional) is not 200, a red colored message is sent with a warning sign.
Slack
Deploy
create_function.sh notify_slack
Update
update_function.sh notify_slack
Usage
- Generate a basic execution lambda role and set the
ROLE_ARN
environment variable to it. - Generate a Slack webhook URL. Payload
webhookUrl
should correspond to the webhook URL to post the message to the right channel. - Assuming you have aws config and credentials set up, run
bash create_function.sh notify_discord
to deploy the function. - You can send a payload with 3 fields (
statusCode
,title
,body
) - IfstatusCode
(optional) is not 200, a red colored message is sent with a warning sign.body
accepts markdown.