How to Setup AWS ECS Fargate with a Load Balancer | Step by Step
Why Stack Overflow recommends it
Stack Overflow users link it as a worked walkthrough for getting a containerised app on Fargate behind a load balancer, including when answering networking and 502 or unhealthy-target problems.
Recommended by 3 people across 3 different months, 2022 to 2024.
What it is
A 27-minute step-by-step tutorial from the Be A Better Dev channel that sets up a basic Python app on AWS ECS with Fargate and puts an Application Load Balancer in front of it. It covers the console configuration and links to the sample code on GitHub.
What people said
Recommends JianYA · 2022-05 · Stack Overflow · on “AWS Load Balancer Bad Gateway error and target group unhealthy”
I have followed this tutorial: [this video] to learn to setup my Load Balancer that connects to Fargate. I have also followed this answer: AWS Error : None of these Availability Zones contains a healthy target. Requests are being routed to all targets. in AWS [LINK] To check if my security groups have been linked properly. However, after setting it up, when I try to access my load balancer URL, I get a 502 Bad Gateway error. I have checked on the monitoring tab on my load balancer and I can see that there was a request coming in. I have 2 security groups: VPC Security Group (ECS) - sg-05c038a61c8a39401 EC2 Security Group (Load Balancer) - sg-0d50dc5f42650f6b6 What I have done: Navigated to the Se
Recommends Alvin Smith · 2023-02 · Stack Overflow · on “AWS Batch Timeout connecting to ECR”
The best answer is right. "The VPC setting "auto assign public IPv4 address" only applies to EC2 instances I believe. For Fargate tasks in ECS or Batch, you need to enable the assignPublicIp setting." Albeit please make sure the VPC is correct first before diving into roles, tasks and policy. To configure VPC for Fargate correctly: [LINK] [this video] The first video is the one I followed since I didn't want a load balancer. Although, I turned on the auto-generated subtitles as it's in Spanish.
Recommends Andrey Mazur · 2024-01 · Stack Overflow · on “Need desperate help deploying a streamlit app using ECR + ECS on AWS. Unsure if networking issue or something else”
I had the same issue. Please use this tutorial [this video] Following steps should be done: replace the flask app with your streamlit app replace port 8080 to 8501 everywhere