aws-to-slack
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "aws-to-slack", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Forward AWS Notification Messages to Slack", | ||
@@ -8,3 +8,3 @@ "main": "handler/index.js", | ||
"test": "node src/test", | ||
"lint": "node node_modules/eslint/bin/eslint.js . --ext .jsx --ext .js || exit 0" | ||
"lint": "eslint . --ext .jsx --ext .js || exit 0" | ||
}, | ||
@@ -22,4 +22,4 @@ "author": "Andre Rabold", | ||
"devDependencies": { | ||
"aws-sdk": "^2.106.0", | ||
"eslint": "^4.5.0", | ||
"aws-sdk": "^2.123.0", | ||
"eslint": "^4.7.2", | ||
"eslint-plugin-import": "^2.7.0", | ||
@@ -26,0 +26,0 @@ "eslint-plugin-lodash": "^2.4.5", |
# AWS-to-Slack | ||
[![npm](https://img.shields.io/npm/v/aws-to-slack.svg)](https://www.npmjs.com/package/serverless-sentry) | ||
[![npm](https://img.shields.io/npm/v/aws-to-slack.svg)](https://www.npmjs.com/package/aws-to-slack) | ||
[![license](https://img.shields.io/github/license/arabold/aws-to-slack.svg)](https://github.com/arabold/aws-to-slack/blob/master/LICENSE) | ||
@@ -5,0 +5,0 @@ [![dependencies](https://img.shields.io/david/arabold/aws-to-slack.svg)](https://www.npmjs.com/package/aws-to-slack) |
@@ -20,5 +20,6 @@ "use strict"; | ||
// CloudWatch Alarm | ||
const accountId = message.AWSAccountId; | ||
const alarmName = message.AlarmName; | ||
// const description = message.AlarmDescription; | ||
// const oldState = message.OldStateValue; | ||
const oldState = message.OldStateValue; | ||
const newState = message.NewStateValue; | ||
@@ -50,4 +51,4 @@ const reason = message.NewStateReason; | ||
fields: [{ | ||
title: "New State", | ||
value: newState, | ||
title: "Acount ID", | ||
value: accountId, | ||
short: true | ||
@@ -58,2 +59,10 @@ }, { | ||
short: true | ||
}, { | ||
title: "Old State", | ||
value: oldState, | ||
short: true | ||
}, { | ||
title: "New State", | ||
value: newState, | ||
short: true | ||
}], | ||
@@ -60,0 +69,0 @@ ts: Slack.toEpochTime(new Date(time)) |
@@ -11,5 +11,6 @@ "use strict"; | ||
return BbPromise.try(() => { | ||
let text, time; | ||
let text, time, title; | ||
if (_.has(event, "Records[0].Sns.Message")) { | ||
// Output the SNS message body | ||
title = _.get(event, "Records[0].Sns.Subject"); | ||
text = _.get(event, "Records[0].Sns.Message"); | ||
@@ -31,5 +32,5 @@ time = new Date(_.get(event, "Records[0].Sns.Timestamp")); | ||
color: Slack.COLORS.neutral, | ||
// author_name: "AWS Notification", | ||
text: text, | ||
ts: Slack.toEpochTime(time ? time : new Date()) | ||
ts: Slack.toEpochTime(time ? time : new Date()), | ||
title, | ||
text | ||
}] | ||
@@ -36,0 +37,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1513894
938
24