-1

We current have an ASP.NET Core Web API hosted in AWS Fargate service. I have added a few health checks to the .NET Core app, like the database health check and few others for cache reset/reload.

If any of these checks fail, the /status endpoint of the app will return status as "Unhealthy". If AWS receives a call to an unhealthy service, how will it handle it?

Will AWS check for the status of the app and return a message built from its side?

Or will it return a message saying the endpoint is unreachable?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Giridhar94
  • 29
  • 5
  • How have you configured AWS to be aware of those health checks exactly? Via a health check script configured in the Task Definition? Or via a health check setting in the load balancer's target group? – Mark B Feb 25 '22 at 15:53
  • Here's the doc that you can refer to, I am not sure if you have explored the service by yourself. Fell free to rephrase the question to something more concrete.https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html – Nick Mar 07 '22 at 03:29

1 Answers1

0

If any of these checks fail, the /status endpoint of the app will return status as "Unhealthy". If AWS receives a call to an unhealthy service, how will it handle it?

You running your app in fargate, if the health check fails, the task will be drained and stopped. Load balancer will stop sending traffic to the node.

Refer AWS docs:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html


Will AWS check for the status of the app and return a message built from its side?

Healthchecks are to determine the state of the application & stop redirecting traffic to nodes that are unhealthy & nothing more. If you wish to return messages to the client it's the dev's job to return such messages.

If all your nodes fail simultaneously your load balancer will return a 5XX error (service unreachable).

Nick
  • 179
  • 1
  • 10