aws-samples / amazon-cloudwatch-auto-alarms

Automatically create and configure Amazon CloudWatch alarms for EC2 instances, RDS, and AWS Lambda using tags for standard and custom CloudWatch Metrics.
MIT No Attribution
90 stars 84 forks source link

Update and refresh alarms when an alarm tag is updated #38

Open mpechner-akasa opened 1 year ago

mpechner-akasa commented 1 year ago

If the alert tag is changed, or the defaults are changed, then new alerts are created. But the current alerts that are meant to be replaced are left as is.

There is a scan function, possibly a refresh that will delete alerts and re add them.

Possibly allow args and the function to run with parameters. So as a lambda lambda handler is called. From main another function. I've had code used as lambda and called from CLI.

knizami commented 1 year ago

Hi @mpechner-akasa, thanks for opening this issue and feature request. You are correct, if you change the tag it is additive and doesn't eliminate the previous alarm tag. I will work on the solution for this so that it will do a true "rescan" of tags and also remove alarms that are present for which no corresponding tag now exists.