Tar
Tar

Reputation: 193

process URL in AWS Lambda before sending to ALB

I am currently setting up an ALB which will contain 90 rules based on the path pattern. Since the maximum rules supported by the ALB is 100 and regex expressions are not allowed in the path pattern expression, I need to find a workaround to lower the number of rules setted in the ALB.

My idea was to process the URL received in lambda before sending it to the ALB, which will potentially lower the rules on the ALB side.

Is this a good way to reduce the number of rules in ALB ? I am worried about the number of lambda parallel executions since it's limited to 1000, is there any other option with managed AWS services other than lambda to do this ?

Thanks !

Upvotes: 0

Views: 244

Answers (2)

Jason Wadsworth
Jason Wadsworth

Reputation: 8885

I wouldn't be concerned about the lambda executions. 1000 is actually a pretty big number, and it's a soft limit (you can request more). If you have a lambda that executes in 100ms you can run 10K request/second, and that's without bursting (you can exceed the limit for short bursts).

As for the number of rules in the ALB, you might want to consider using an API Gateway instead, if you have that many rules that are path based. As another answer pointed out, you can use CloudFront to increase the number of rules available by having more than one ALB, and sub-routing based on part of the path.

Upvotes: 0

Ivan Shumov
Ivan Shumov

Reputation: 634

You can do it, but it will affect your performance a lot. You can try to use CloudFront on top of ALB. Also, you can launch multiple ALB's and set them behind CloudFront

Upvotes: 1

Related Questions