0

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?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Kohini
  • 427
  • 2
  • 6
  • 14
  • Have you considered removing the EC2 instance(s) from the Load Balancer target group before stopping it? That would avoid it being seen as 'unhealthy'. – John Rotenstein Dec 01 '20 at 10:07
  • The alarm points to a target group. Not sure if removing the instance from target group also trigger the alarm because there is no host. I'll try it out – Kohini Dec 02 '20 at 13:55
  • Are you saying that you have a Load Balancer in front of a _single_ Amazon EC2 instance? If so, why did you choose that design? – John Rotenstein Dec 03 '20 at 03:28
  • Indeed, at this point is just the one instance(perhaps not for any specific reason). It would work even if I changed domain to point to the instance instead of the load balancer – Kohini Dec 03 '20 at 07:21

1 Answers1

0

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

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470