Mapping Load Balancer Ports in the ECS Service

0

please understand that I am not good at English.

Suppose the ECR has a repository called AAA and uses EXPOSE port 8080.

Create an ECS cluster and configure containers when defining tasks. Add port mapping information from the container, enter 8080. Enter container port mapping information 8080.

You are about to create a cluster service. If you add a task that you just created here and set the load balancer type to Application, it will automatically write AAA 8080:8080 in the select box of the container selection to load balance. But I want the host mapping to be 443 ports.

Is there any way I can set it to 8080:443?

已提問 2 年前檢視次數 1060 次
1 個回答
2
已接受的答案

By "8080:443", I'm assuming you want the LB to listen on port 433 and forward traffic to containers running on 8080. In which case you need to do the following:

  1. Create and configure a target group that is configured for port 8080.

  2. Create and configure your load balancer to listen on port 443 (including specifying the SSL cert to use) and forward traffic to target group created in step1

  3. When configuring the ECS service and specifically "Container to load balance" step, Select Add to Load balancer.

    Select production listener port as 443:HTTPS and for target group name you can select the TG you created.

Some reference documents:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-application-load-balancer.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service-console-v2.html

--Syd

profile picture
Syd
已回答 2 年前
profile pictureAWS
專家
Toni_S
已審閱 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南