Tune RDS messages
All checks were successful
ZeroDownTime/sns-alert-hub/pipeline/head This commit looks good
ZeroDownTime/sns-alert-hub/pipeline/tag This commit looks good

This commit is contained in:
Stefan Reimer 2023-06-16 15:03:52 +00:00
parent 9229d32110
commit 3831ee7774

10
app.py
View File

@ -264,8 +264,14 @@ def handler(event, context):
elif "Event Source" in msg and msg['Event Source'] == "db-instance":
try:
title = msg["Event Message"]
body = "for instance <{}|{}> - <{}|Event docs>".format(
msg["Identifier Link"], msg["Source ID"], msg["Event ID"])
try:
name = " ({}).".format(
msg["Tags"]["aws:cloudformation:stack-name"])
except (KeyError, IndexError):
name = ""
body = "RDS Instance: <{}|{}>{}\n<{}|Event docs>".format(
msg["Identifier Link"], msg["Source ID"], name, msg["Event ID"])
except KeyError:
msg_type = apprise.NotifyType.WARNING
body = sns["Message"]