ALB health checks failing

0

I have ALB on ECS fargate service running FAST API. Health checks are constantly failing even though with curl I can access that same endpoint and get result with status code 200.

Enter image description here

Enter image description here

Enter image description here

Security group of ecs task:

  1. VPN so it's working with curl
  2. Inbound from load balancer.

Enter image description here

  • What are the rules on your security group?

  • hello iBenhr, I upload screenshot of my security group.

  • ELB SG should also allow the egress connection. Have you checked that? The error showing is a timeout which means that the ELB is unable to connect to the ECS Task. I'd double check the SG rules from both sides to confirm.

已提問 1 個月前檢視次數 862 次
2 個答案
2

Hi,

Whenever you deploy your application through AWS ECS Fargate, sometimes in an AWS Free Tier account, it shows the target group health check as 'Unhealthy', even though the website opens successfully. If you need to check if the ALB security group allows inbound rules for HTTP and HTTPS on port SSH, or if HTTPS and port SSH are not required, leave them out. When checking the ECS security group, ensure that the necessary ports are allowed, including those you've mentioned by their port numbers.

已回答 1 個月前
0
已接受的答案

The screengrab of the security group rule (presumably the one associated with ECS cluster) shows it allows inbound port 80 from (what is presumably) the load balancer security group.

A rule the other way round needs to exist as well, that is the security group associated with the load balancer needs to have an outbound rule whose target is ECS on port 3000 - whether that's IP address(es), or the subnet, or the security group which is already associated with the ECS cluster.

profile picture
專家
Steve_M
已回答 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南