Add Listener to Application Load Balancer
Add Listener to Application Load Balancer
- Initialize an ApplicationListener:
ApplicationListener applicationListener = productsServiceProps.applicationLoadBalancer();

- Add a listener with the ID ProductsServiceAlbListener and initialize ApplicationListenerProps:
.addListener("ProductsServiceAlbListener", ApplicationListenerProps.builder()
.build());

- Next, configure the ALB listener on port 8081 using the HTTP protocol:
.port(8081)
.protocol(ApplicationProtocol.HTTP)

- Finally, add the applicationListener to the Application Load Balancer:
.loadBalancer(productsServiceProps.applicationLoadBalancer())
