Skip to content

Commit

Permalink
Loading incoming event into dictionary if from Cloudwatch. (terraform…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Lucas committed Jan 12, 2019
1 parent cd02ea2 commit 3310cbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/notify_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def notify_slack(message, region):
"icon_emoji": slack_emoji,
"attachments": []
}
if "AlarmName" in message:
if "AlarmName" in message: # Incoming event is from Cloudwatch
message = json.loads(message)
notification = cloudwatch_notification(message, region)
payload['text'] = "AWS CloudWatch notification - " + message["AlarmName"]
payload['attachments'].append(notification)
Expand Down

0 comments on commit 3310cbe

Please sign in to comment.