Skip to content

Instantly share code, notes, and snippets.

@JeffRausch
JeffRausch / function.js
Last active Jun 11, 2018 — forked from vgeshel/function.js
Function to send an AWS CloudWatch alarm message to Slack
View function.js
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
You can’t perform that action at this time.