Aws ecs task failed ELB health check


Hi, I am trying to setup an airflow application in ECS using EC2 launch type using teraform. Now I get error for webserver (saying task failed loadbalancer health check).I have tried various solutions but still it isint working. With the same code using Fargate launch type I am not receiving this error. Can you please help solve the issue

  • What type of solutions have you tried, and are you still encountering this issue?

2 Answers


We understand that you are having difficulties with your ELB health checks. We suggest that you check your security group settings to ensure that the port and protocol are properly added to allow the health checks to pass[1]. Your target security group should allow inbound HTTP/TCP traffic on port 80 this will allow the ELB to monitor the target instances/ECS cluster. We also suggest checking the rules for your ELB's Security group as the traffic may be stopped there, ensure that HTTP/TCP traffic is allowed out to Target instance. In short make sure the health check port and protocol is allowed in both Target instance's security group as well as ELB's security group.

Please contact if you have any further questions, and feel free to reach out to us via a support case to facilitate a discussion on the specifics of your resources.

    [1] (
    [2] (
    [3] (
    [4] (
answered 2 years ago


Dealing with those pesky health check issues can be really nerve-wracking, but don't worry, we've got your back :)

I've been down the ECS rabbit hole myself, and those launch type differences can be a real headache. The fact that it works like a charm with Fargate but throws a tantrum with EC2 launch type is a puzzle, right? Here's a suggestion: have you double-checked your security group settings? Sometimes, it's those sneaky rules that cause these health check failures. You won't believe me, but I had so much trouble working on a similar problem here: But this is what worked for me, so double-check a few times! Make sure the port and protocol for your airflow application are properly added to allow those health checks to pass through.

It's funny how AWS keeps us on our toes, teaching us new things every day. My advice would be to keep tinkering and testing. Remember, each configuration tweak is a step closer to the solution. And hey, if you get it sorted, don't forget to share your triumph with the community – we could all learn from your experience!

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions