Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my ECS task public IP not loading, if the logs say the service has started?

I'm trying to deploy a super simple containerized flask app to ECS. I know the image is docker-compose-able and building fine because I have it as part of a CodePipeline that's building, tagging and pushing the final docker image to ECR.

Build completed on Sat Feb 15 21:48:44 UTC 2020

[Container] 2020/02/15 21:48:44 Running command echo Pushing the Docker images...
Pushing the Docker images...

[Container] 2020/02/15 21:48:44 Running command docker push $REPOSITORY_URI:latest
...
025f20c0831b: Pushed
98e916abdf11: Pushed

I should probably clarify at this point that the application works locally, and I've specified the app.run() host to 0.0.0.0.

At this point I have an ECS Cluster

enter image description here

with a running task and public IP

enter image description here

and logs that indicate the app has started.

enter image description here

I have also modified the security group's inbound ports to include 5000 on 0.0.0.0, ::/0.

enter image description here

Theoretically this means you should be able to visit the port 3.80.1.115, but instead you should be seeing the standard, what did you just even type in response from your browser.

enter image description here

I'm just not sure what is happening anymore because I seem so close... the app is running without errors in ECS and everything is wonderful except the app is, well, inaccessible. Thoughts?

like image 770
notacorn Avatar asked Jan 28 '26 10:01

notacorn


1 Answers

My case is slightly different. I used the default network settings. The problem is that the default security group doesn't allow inbound traffic from the internet. To fix it:

  1. Open the security group settings
  2. Press "Edit inbound rules"
  3. Add a rule with type "All traffic" (or "Custom TCP" if you want to whitelist a specific port) and source "Anywhere-IPv4"
  4. Press "Save rules" and you're done
like image 69
Finesse Avatar answered Jan 30 '26 23:01

Finesse