简体   繁体   中英

How to use same application loadbalancer for different elasticbeanstack application environment using cloudformation template?

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.

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

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. ie either Beanstalk scales all services together, or none of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM