How to set the Load balancer service to route a certain host to a fargate task?

0

Currently I have plenty of ECS Fargate tasks, my question is I wanted to use the Load Balancer to forward all the request with certain host header to just a task only, maintaining the port numbers.

  • Hello, I don't believe AWS ALBs and Fargate currently support this functionality. However, you could try to add the target manually to the target group by public or private IP and remove other targets from your group. Alternatively, you could create a second service with only one running task and set up a separate load balancer for it.

    If you provide more details as to why you only want to route to one specific task, I may be able to brainstorm alternative solutions.

  • Hi, Currently I'm planning to deploy a scalable session based websocket server on AWS using Fargate, each user will assigned a room automatically once they request to join and their message transmission should be encrypted(SSL). I plan to do the SSL part on the load balancer and hoping to do as what you said for the address routing.

1 回答
0
已接受的回答

I'm not sure how to route to a particular fargate task. However, I think you can route to different fargate services based on incoming route paths in Application Load Balancer. You can create a ALB with different listeners along with its associated targets. Then, when you're creating fargate service, you can attach this load balancer.

You can refer this article - https://aws.amazon.com/blogs/containers/using-aws-application-load-balancer-path-based-routing-to-combine-amazon-ecs-launch-types/

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则