0

I am running an application with different services. I have deployed it as a microservice pattern using elastic beanstalk. Each microservice is hosted in a separate elastic beanstalk environment but within the same application.

I have automated the deployment process with cloud formation template. I have created a resource for each application environment through the template. It is created. Beanstalk environment uses default target group and separate application load balancer for each environment, If I add more number of microservices to my application, which requires more number of the application load balancer, But a single application load balancer can be used to route the traffic of the different microservice target groups.

I have checked about the parameters available in the resource. The main option is available in beanstalk environment resource is a single instance or load-balanced environment. If I choose single instance, then it will not create any load balancer. It just creates a single EC2 server and deploys the application. Apache/Nginx acts as a reverse proxy server to access the endpoint. At the same time, if I use a load balanced environment, I can configure settings related to the application load balancer. But I do not find any way to reuse a single Application load balancer, Do we have such support in AWS right now, AWS has added some options to control ELB from elastic beanstalk.

DJo
  • 2,133
  • 4
  • 30
  • 46
Radhakrishnan Rk
  • 553
  • 3
  • 13

2 Answers2

0

You can extend the Single Application Load Balancer capabilities to rules, targets, and target groups. Where let's Say your Environment 1 has an application name APPLICATION-1 and Environment 2 has an application name APPLICATION-2. using ALB through target groups you can define such rules.

Reference Link

Yash Bindlish
  • 560
  • 5
  • 15
  • My usecase is based on the reference link you shared. I can do this manually by creating a separate target group for each microservice and use alb for routing the requests. I want to automate the process through cloudformation, It is a resource reference. http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elbv2 . It does not contain any way to reuse the same alb for different applications. – Radhakrishnan Rk Dec 06 '18 at 13:04
  • You can define the parameters into your Policy template through cloudformation where you define Target groups. https://stackoverflow.com/questions/39520067/creating-an-alb-target-group-in-cloudformation – Yash Bindlish Dec 06 '18 at 13:15
  • Thanks for sharing, here the environment is elasticbeanstack. will try this soluion. – Radhakrishnan Rk Dec 06 '18 at 13:20
  • You can consider using AWS API gateway in front of Load Balancers. Details are here- https://stackoverflow.com/questions/63158805/is-it-possible-to-do-path-based-routing-across-different-elastic-beanstalk-appli/63159859#63159859 – Robin Varghese Jul 31 '20 at 13:05
0

Unfortunately, it is presently not possible to associate a single Load Balancer with multiple Beanstalk environments. The closest you can get to deploying separate services under a single Load Balancer using Beanstalk is to use the Multi-Container Docker platform. However, under this scheme, your services cannot be scaled independently. i.e. either Beanstalk scales all services together, or none of them.

progfan
  • 2,454
  • 3
  • 22
  • 28