Adding delay to aws alarm on ec2 startup

191 views Asked by At

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?

1

There are 1 answers

0
John Rotenstein On BEST ANSWER

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

  • Do not use a Load Balancer
  • Add an Elastic IP address to the instance
  • Point the DNS Name to the Elastic IP address

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