Skip to content

Beanstalk: Routing to the _same_ instance based on url path

0

I am currently using Beanstalk with an Application Load Balancer. I want to achieve the following load balancing rule:

  1. Given websocket requests a) myapi.com?param=1 b) myapi.com?param=2 c) myapi.com?param=1
  2. I want all the requests with the same param to route to the same ec2 instance. (In the example above a & c would go to the same ec2 instance)

How would you achieve this?

  1. I don't think I can use. Application Load Balancer, as it routes to target groups, and afaik Beanstalk only has one target group
  2. I can't quite use session affinity, as it's about routing the same client to the same machine, whereas this would route multiple different clients to the same machine
asked 2 years ago348 views
1 Answer
0

Hello,

This thread explains a similar use case that you want to achieve with Application load balancer and AWS beanstalk application. https://stackoverflow.com/questions/41807676/load-balancing-across-different-elastic-beanstalk-applications

Also refer this blog posts to share ALB across different Beanstalk application and environment: https://aws.amazon.com/blogs/containers/amazon-elastic-beanstalk-introduces-support-shared-load-balancers/

ALB supports advance routing methods like host, headers, path, query, source IP based routing.

References:

  1. https://repost.aws/knowledge-center/elb-achieve-path-based-routing-alb
  2. https://exampleloadbalancer.com/advanced_request_routing_demo.html

Hope this helps

EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.