Tune RDS messages

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": elif "Event Source" in msg and msg['Event Source'] == "db-instance":
try: try:
title = msg["Event Message"] title = msg["Event Message"]
body = "for instance <{}|{}> - <{}|Event docs>".format( try:
msg["Identifier Link"], msg["Source ID"], msg["Event ID"]) 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: except KeyError:
msg_type = apprise.NotifyType.WARNING msg_type = apprise.NotifyType.WARNING
body = sns["Message"] body = sns["Message"]