AWS Elastic Beanstalk
Developer Guide

Load Balancer for Your AWS Elastic Beanstalk Environment

When you enable load balancing, AWS Elastic Beanstalk creates an Elastic Load Balancing load balancer for your environment. The load balancer distributes traffic among your environment's instances.

Elastic Beanstalk supports these load balancer types:

  • Classic Load Balancer – The Elastic Load Balancing previous-generation load balancer. Routes HTTP, HTTPS, or TCP request traffic to different ports on environment instances.

  • Application Load Balancer – An application layer load balancer. Routes HTTP or HTTPS request traffic to different ports on environment instances based on the request path.

  • Network Load Balancer – A network layer load balancer. Routes TCP request traffic to different ports on environment instances. Supports both active and passive health checks.

By default, Elastic Beanstalk creates an Application Load Balancer for your environment when you enable load balancing with the Elastic Beanstalk console. It configures the load balancer to listen for HTTP traffic on port 80 and forward this traffic to instances on the same port. You can choose the type of load balancer that your environment uses only during environment creation. Later, you can change settings to manage the behavior of your running environment's load balancer, but you can't change its type.

Note

Your environment must be in a VPC with subnets in at least two Availability Zones to create an Application Load Balancer. All new AWS accounts include default VPCs that meet this requirement. If your environment is in a VPC with subnets in only one Availability Zone, it defaults to a Classic Load Balancer. If you don't have any subnets, you can't enable load balancing.

You can create and manage environments with all load balancer types using the Elastic Beanstalk console, the EB CLI eb create command, the Elastic Beanstalk APIs, or configuration files (.ebextensions).

See the following topics to learn about each Elastic Beanstalk-supported load balancer type, its functionality, and how to configure and manage it in an Elastic Beanstalk environment, and how to configure a load balancer to upload access logs to Amazon S3.