Created
May 31, 2018 05:11
-
-
Save sureshamk/ee5a3817c678030cfbbff66945446404 to your computer and use it in GitHub Desktop.
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 processRecord = (record) => { | |
const subject = record.Sns.Subject; | |
const message = JSON.parse(record.Sns.Message); | |
return sendMessage({ | |
text: subject, | |
attachments: [{ | |
text: message.NewStateReason, | |
fields: [{ | |
title: 'Time', | |
value: message.StateChangeTime, | |
short: true, | |
}, { | |
title: 'Alarm', | |
value: message.AlarmName, | |
short: true, | |
}, { | |
title: 'Account', | |
value: message.AWSAccountId, | |
short: true, | |
}, { | |
title: 'Region', | |
value: message.Region, | |
short: true, | |
}], | |
}], | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment