Skip to content

Instantly share code, notes, and snippets.

@sureshamk
Created May 31, 2018 05:11
Show Gist options
  • Save sureshamk/ee5a3817c678030cfbbff66945446404 to your computer and use it in GitHub Desktop.
Save sureshamk/ee5a3817c678030cfbbff66945446404 to your computer and use it in GitHub Desktop.
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