3
votes

The Elastic Beanstalk documentation mentions that the load balancer type can be set with a config file in the .ebextensions folder. However, when I deploy my application in a newly created environment, Elastic Beanstalk still creates a classic load balancer.

I am creating the new environment through the AWS console and my application source package has the .ebextensions folder with settings specifying an application load balancer. As seen below:

.ebextensions/application-load-balancer.config

option_settings:
  aws:elasticbeanstalk:environment:
    LoadBalancerType: application

Am I missing a step during the creation of the environment? Have other people ran into this issue?

1
Can you try creating a default listener as described here in addition to specifying the kind of load balancer?progfan
How are you verifying that "Elastic Beanstalk still creates a classic load balancer"? The settings you have seem to be working for me, but there does not appear to be an explicit confirmation for LoadBalancerType on the EB Configuration screen in the AWS Console.Dem Pilafian
@DemPilafian when I checked the EC2 page, it showed my load balancer was still classicjohnnyodonnell
The EB "Networking Tier" section normally shows a box for "Load Balancing", but it is not there with the LoadBalancerType: application setting (yet the EC2 page still displays classic... interesting).Dem Pilafian

1 Answers

1
votes

I ran into this issue as well, and from testing it appears that these .ebextensions /application-load-balancer.config settings only work if you create the environment with High Availability specified. So you can't just select the platform and upload your code and have the application load balancer and High Availability setup configured from the .config settings (even though the docs make it seem like this should work). Instead you must select the desired platform (PHP, etc.), upload your initial code, and then click on More Options and select the configuration preset for "High Availability". You may also need to select your VPC at this point as well, if you are deploying into a custom VPC network. You don't need to set any other settings, as those will be applied from your application-load-balancer.config file (and other .config files). It just seems that there's a distinction between environment creation and environment config, and some of these values can only be set during the "creation" step.