I am trying to configure load balancing with my ECS Fargate cluster. Currently I have an application load balancer setup to do redirects from port 80 to port 9003. Port 9003 is the port the containers are using for their service. I would like the load balancer to redirect to port 9003 over HTTPS if that is possible. Currently I have a listener for port 9003 that forwards to an IP based target group. Below are the details for the target group:
The container is designed to run a script at startup. When running the script locally, it takes a few minutes to complete. I am not sure if I need to increase the timeout and interval settings in the target group. I also have a security group set up with the ECS Service. Currently, it allows any traffic from the application load balancer to reach the container running on the service. I have also specified an ingress rule for the container port (9003) to be able to communicate with anything with the VPC.
The issue I am being faced with deals with the containers being in a loop where they provision and then minutes later they drain, stop, and ECS Fargate spins up a new IP in the target group. The only details present are as follows:
Stopped reason Essential container in task exited
Under Details in the Container section:
Exit Code 0
Entry point ["bash"]
Command ["/tmp/init.sh"]
Any advice on how to overcome this would be helpful.