Add support for ElastiCache replacement schedule notifications

This commit is contained in:
Stefan Reimer 2023-05-19 10:21:44 +00:00
parent 0d6ef359f5
commit bb13496ac3

8
app.py
View File

@ -238,12 +238,18 @@ def handler(event, context):
except KeyError: except KeyError:
pass pass
# New simple ElasticCache notifications # ElasticCache snapshot notifications
elif "ElastiCache:SnapshotComplete" in msg: elif "ElastiCache:SnapshotComplete" in msg:
title = "ElastiCache Snapshot complete." title = "ElastiCache Snapshot complete."
body = "Snapshot taken on {}".format( body = "Snapshot taken on {}".format(
msg["ElastiCache:SnapshotComplete"]) msg["ElastiCache:SnapshotComplete"])
# ElasticCache replacement notifications
elif "ElastiCache:NodeReplacementScheduled" in msg:
title = "ElastiCache node replacement scheduled"
body = "{} will be replaced between {} and {}".format(
msg["ElastiCache:NodeReplacementScheduled"], msg["Start Time"], msg["End Time"])
# Basic ASG events # Basic ASG events
elif "Origin" in msg and msg["Origin"] == "AutoScalingGroup": elif "Origin" in msg and msg["Origin"] == "AutoScalingGroup":
title = msg["Description"] title = msg["Description"]