0

I'm using AWS ALB to behave load balancing and got a problem. Is there way to change listener rule when certain target group is unhealty?

I have ALB which is assigned to 2 target groups A and B(each has 1 ec2 instance server). And there're listener rule like this, if the parameter 'type' of request is '1', the request is sended to target group A, and if 'type' is '2', sended to group B. But I need to add this rule. If A is dead, all requests should go to group B, regardless of the parameter 'type'. And If B dead, all go to A. Is there ansy

yubin
  • 125
  • 8
  • There is no such option. You would have to develop a custom solution for that, e.g. have a lambda periodically check your ALB and modify it if needed. – Marcin Mar 30 '23 at 01:16
  • you have cloudwatch metrics so it wouldn't be hard to create an alarm and then trigger a lambda. But metrics lag by several minutes so it's not a good solution for reliability. It would be better to route requests to both servers or add servers to each role. – erik258 Mar 30 '23 at 01:23

0 Answers0