Creating a Network Load Balancer

This section walks you through the process of creating a Network Load Balancer in
the
AWS Management Console.

Define Your Load Balancer

First, provide some basic configuration information for your load balancer,
such as a name, a network, and a listener.

A listener is a process that checks for
connection requests. It is configured with a protocol and port for the frontend
(client to load balancer) connections, and a protocol and port for the backend
(load balancer to backend instance) connections. In this example, you configure
an Internet-facing load balancer in the selected network with a listener that
receives TCP traffic on port 80.

For Scheme, choose either
internet-facing or
internal. An internet-facing load
balancer routes requests from clients over the internet to
targets. An internal load balancer routes requests to targets
using private IP addresses.

For Listeners, the default is a listener
that accepts TCP traffic on port 80. You can keep the default
listener settings, modify the protocol or port of the listener,
or choose Add listener to add another
listener.

Note

If you plan on routing traffic to more than one target
group, see ListenerRules for details on how to add host or
path-based rules.

For Availability Zones, select the VPC
that you used for your Amazon EC2 instances. For each Availability
Zone that you used to launch your Amazon EC2 instances, select an
Availability Zone and then select the public subnet for that
Availability Zone. To associate an Elastic IP address with the
subnet, select it from Elastic IP.

Choose Next: Configure Routing.

Configure Routing

You register targets, such as Amazon EC2 instances, with a target group. The target
group that you configure in this step is used as the target group in the
listener rule, which forwards requests to the target group. For more
information, see Target Groups for Your Network Load Balancers.

To configure your target group

For Target group, keep the default, New
target group.

For Name, type a name for the target
group.

Set Protocol and Port as
needed.

For Target type, choose whether to register your
targets with an instance ID or an IP address.

Important

If your service's task definition uses the awsvpc
network mode (which is required for the Fargate launch
type), you must choose ip as the target type, not
instance. This is because tasks that use the
awsvpc network mode are associated with an elastic
network interface, not an Amazon EC2 instance.

For Health checks, keep the default health check
settings.

Choose Next: Register Targets.

Register Targets with the Target
Group

Your load balancer distributes traffic between the targets that are registered
to its target groups. When you associate a target group to an Amazon ECS service,
Amazon ECS automatically registers and deregisters containers with your target group.
Because Amazon ECS handles target registration, you do not add targets to your target
group at this time.

To skip target registration

In the Registered instances section, ensure that
no instances are selected for registration.

Choose Next: Review to go to the next page in the
wizard.

Review and Create

Create an Amazon ECS Service

After your load balancer and target group are created, you can specify the
target group in a service definition when you create a service. When each task
for your service is started, the container and port combination specified in the
service definition is registered with your target group and traffic is routed
from the load balancer to that container. For more information, see Creating a Service.

Javascript is disabled or is unavailable in your browser.

To use the AWS Documentation, Javascript must be enabled. Please refer to your browser's
Help pages for instructions.