Introduction

Every development team has one, that critical application that runs the business, that nobody dares to touch, and that a brave team somewhere is slowly rewriting. In the meantime, the business doesn't stop. New requirements keep coming, and someone has to handle them.

The classic dilemma : do you ask the team rewriting the application to squeeze in this new feature, slowing down their already complex work ? Or do you modify the legacy codebase yourself, knowing that one wrong move could break something nobody fully understands anymore ?

There is a third option that most developers overlook : intercept the request at the load balancer level and handle it with an AWS Lambda function, without touching the legacy application at all. Not a single line of code changed. Not a single deployment risk.

In this article, you will learn how to use an Application Load Balancer (ALB) listener rule to route a specific URL path to a Lambda function, while everything else continues flowing normally to your existing EC2 application.