I am starting in AWS and server management in general and just set up a deployment pipeline with ECS and some containers.
My container :
- My host port is 0 and redirected to container port 4200 (Angular default port)
- Is behind an Application Load Balancer
- A dynamic port is assigned
While I read the port mapping and load balancing documentations, I can’t wrap my head around how I can retrieve that port automatically and route it to the port 80. What I want is basically to access my website without port specification in the URL.
I know I can find the default port range in there :
Where I am stuck currently is :
1 – How can the chosen ephemeral port be mapped to the default http traffic port (80)
2 – How can I make sure that if the port is already in use, I still fetch the right port in the ephemeral port range so that this one can be mapped to 80.