Send AWS Amplify Pipeline Notifications on Slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch') | |
// this should be your webhook URL (doc: https://api.slack.com/messaging/webhooks) | |
const integrationURL = '' | |
exports.handler = async (event) => { | |
const message = event.Records[0].Sns.Message | |
return await fetch(integrationURL, { | |
method: 'POST', | |
body: JSON.stringify({ | |
attachments: [{ | |
title: `AWS Amplifyy Notification!`, | |
text: message, | |
}] | |
}), | |
headers: { 'Content-Type': 'application/json' }, | |
}) | |
.then((data) => console.log('sent!')) | |
.catch((e) => console.error(e.response.data)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tutorial: https://dev.to/aws-builders/enable-slack-notifications-for-aws-amplify-deployments-5a0l