Elastic Beanstalk without Elastic Load Balancer

Amazon Web-ServicesAmazon Ec2CloudLoad BalancingAmazon Elastic-Beanstalk

Amazon Web-Services Problem Overview


I would like to switch off Elastic Load Balancer (ELB) for my Elastic Beanstalk environment.

Currently I don't need it and I don't want to pay for it.

It is possible to delete the ELB in EC2 managment window but then Elastic Beanstalk health state is switched from GREEN to RED. I just found a information that it's not possible.

Does someone has a trick how to run Elastic Beanstalk without load balancing and have environment GREEN health state?

Amazon Web-Services Solutions


Solution 1 - Amazon Web-Services

Since July 2013 Elastic Beanstalk supports "single-instance" environments that have a single container instance running without a load balancer. Existing environments that are set up using "load balancing environment" can be switched to "single instance" and vice versa.

Prior to this it was not possible to remove the load balancer and have Elastic Beanstalk still work correctly. The load balancer is an integral part of the way that Elastic Beanstalk works in "load-balancing environment" configurations.

Solution 2 - Amazon Web-Services

In the new Elastic Beanstalk interface I noticed the option to create my environment as a single instance.

Dropdown with options

I tried it out and, as one might expect, it didn't create an Elastic Load Balancer. Hooray!

The options are described in the AWS EB documentation. At first I recreated the environments I don't need to balance automatically, but apparently you can even switch environment type on the fly.

Solution 3 - Amazon Web-Services

From command line you can do it like this

eb create -s

Note When activating the single instance mode (-s switch) neither the load balancer nor the auto scaling group is created

An alternative approach is to create a worker environment either through the console

enter image description here

or through CLI

eb create -t Worker

Solution 4 - Amazon Web-Services

In a saved configuration, or module-specific env.yaml, use this :

  aws:elasticbeanstalk:environment:
    EnvironmentType: SingleInstance```

To create a single-instance EB environment.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionamraView Question on Stackoverflow
Solution 1 - Amazon Web-ServicesKen LiuView Answer on Stackoverflow
Solution 2 - Amazon Web-ServiceslimeView Answer on Stackoverflow
Solution 3 - Amazon Web-ServicesPeter SzantoView Answer on Stackoverflow
Solution 4 - Amazon Web-ServicesgileriView Answer on Stackoverflow