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?

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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠