Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS load balancer health check with api key

When doing health check in AWS application load balancer, I need set health check to path /service_name/health

But it also need be accessed with api key (a header)

How can I implement this type of health check?

like image 359
Bill Avatar asked Dec 11 '25 17:12

Bill


1 Answers

Unfortunately, there is no direct way of doing this, without a proxy. ALB only supports GET for heath checks.

A workaround is to set status code to 403 (or whatever is returned from your service on failed authentication) instead of 200. This usually works since if the service responds with expected failed authentication code (e.g. 403) you can assume that the application is working.

like image 164
Marcin Avatar answered Dec 13 '25 18:12

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!