Search code examples
amazon-web-servicesamazon-ec2

AWS configure healthcheck EC2


I have a load balancer (LB) and an EC2 instance on AWS. My LB has my domain name associated and supports HTTP and HTTPS connections. It has a health-check configured to an endpoint on my EC2 instance (it's running node).

When trying to hit an endpoint via my domain name, the LB doesn't route traffic to my EC2 because it doesn't see it as a healthy instance. I can hit the endpoint directly with the IP address instead. What sort of response do I need to configure so that my EC2 can be recognized as healthy?

Edit: Using an application load balancer.

Edit 2: Health check configuration.

  • Protocol: HTTPS
  • Path : /callback
  • Port : 443
  • Healthy threshold : 5
  • Unhealthy threshold : 2
  • Timeout : 5
  • Interval : 30
  • Success codes : 200

Solution

  • Solved: with the application LB, all that is needed is a 200-level status code from a designated url. This means that you cannot return a simple text response like "Hello World" when they send their health check request.