amazon-web-servicesamazon-cloudwatchaws-alb

Adding delay to aws alarm on ec2 startup


I have an alarm on application load balancer. It is of type Unhealthy host count

In one of the parameters I've chosen "Treat missing data as missing" because I have a daily schedule to stop the EC2 present under target group under ALB at night and start the EC2 in day time.

Is there a way to delay the alarm to 30 min after the ec2 starts so that the tomcat applications running on EC2 have time to start up before the alarm goes into effect?


Solution

  • Since you only have a single instance, and your goal is to reduce costs, then I would recommend:

    Alternatively, you could probably call DisableAlarmActions - Amazon CloudWatch to temporarily stop the alarms from doing anything, then re-enable them later. You could also do it from the AWS CLI: disable-alarm-actions — AWS CLI Command Reference