AWS Fargate task fails ELB health checks
Solution 1:
You did not include the actual Load Balancer in your template. Please include that, for a full answer.
Your problem is most likely that your Load Balancer - which most likely has a private IP in your subnets and communicates with that - is not allowed to communicate with your ECS instances, since they allow only traffic from 138.106.0.0/16
.
Solution 2:
For others, who might be facing the same issue:
It might be an issue with the route that you configured for health-check.
Your configured route should return a success response(status : 200)
on GET call.
If "/"
is the route you configured for health-check, please make sure you GET call to yourwebsitename.com/
returns a 200
status code.
Similarly, If "/health-check"
you configured for health-check, please make sure you GET call to yourwebsitename.com/health-check
returns a 200
status code.