Elb Gateway
Elb Gateway
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not
Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or
discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may
or may not be affiliated with, connected to, or sponsored by Amazon.
Elastic Load Balancing Gateway Load Balancers
Table of Contents
What is a Gateway Load Balancer? ....................................................................................................... 1
Appliance vendors ...................................................................................................................... 1
Getting started .......................................................................................................................... 1
Pricing ...................................................................................................................................... 1
Getting started .................................................................................................................................. 2
Overview ................................................................................................................................... 2
Routing ............................................................................................................................. 3
Prerequisites .............................................................................................................................. 4
Step 1: Register targets and create a Gateway Load Balancer ........................................................... 4
Step 2: Create a Gateway Load Balancer endpoint .......................................................................... 5
Step 3: Configure routing ............................................................................................................ 6
Getting started using the CLI .............................................................................................................. 7
Overview ................................................................................................................................... 7
Routing ............................................................................................................................. 3
Prerequisites .............................................................................................................................. 9
Step 1: Create a Gateway Load Balancer and register targets ........................................................... 9
Step 2: Create a Gateway Load Balancer endpoint ........................................................................ 10
Step 3: Configure routing .......................................................................................................... 11
Load balancers ................................................................................................................................. 12
Load balancer state .................................................................................................................. 12
Load balancer attributes ........................................................................................................... 12
Availability Zones ..................................................................................................................... 13
Deletion protection ................................................................................................................... 13
Cross-zone load balancing ......................................................................................................... 13
Create a load balancer .............................................................................................................. 14
Step 1: Configure your target group and register targets ....................................................... 14
Step 2: Configure the load balancer and listener .................................................................. 15
Important next steps ........................................................................................................ 16
Update tags ............................................................................................................................. 16
Delete a load balancer .............................................................................................................. 17
Listeners .......................................................................................................................................... 18
Target groups .................................................................................................................................. 19
Routing configuration ............................................................................................................... 19
Target type .............................................................................................................................. 19
Registered targets .................................................................................................................... 20
Target group attributes ............................................................................................................. 20
Deregistration delay .................................................................................................................. 20
Create a target group ............................................................................................................... 21
Configure health checks ............................................................................................................ 23
Health check settings ....................................................................................................... 23
Target health status ......................................................................................................... 24
Health check reason codes ................................................................................................ 25
Target failure scenarios ..................................................................................................... 25
Check the health of your targets ........................................................................................ 26
Modify health check settings ............................................................................................. 26
Register targets ........................................................................................................................ 27
Target security groups ...................................................................................................... 27
Network ACLs .................................................................................................................. 27
Register or deregister targets ............................................................................................. 28
Update tags ............................................................................................................................. 29
Delete a target group ............................................................................................................... 30
Monitor your load balancers .............................................................................................................. 32
CloudWatch metrics .................................................................................................................. 32
Gateway Load Balancer metrics .......................................................................................... 33
iii
Elastic Load Balancing Gateway Load Balancers
iv
Elastic Load Balancing Gateway Load Balancers
Appliance vendors
A Gateway Load Balancer operates at the third layer of the Open Systems Interconnection (OSI) model,
the network layer. It listens for all IP packets across all ports and forwards traffic to the target group
that's specified in the listener rule. It maintains stickiness of flows to a specific target appliance using
5-tuple (for TCP/UDP flows) or 3-tuple (for non-TCP/UDP flows). The Gateway Load Balancer and its
registered virtual appliance instances exchange application traffic using the GENEVE protocol on port
6081. It supports a maximum transmission unit (MTU) size of 8500 bytes.
Gateway Load Balancers use Gateway Load Balancer endpoints to securely exchange traffic across VPC
boundaries. A Gateway Load Balancer endpoint is a VPC endpoint that provides private connectivity
between virtual appliances in the service provider VPC and application servers in the service consumer
VPC. You deploy the Gateway Load Balancer in the same VPC as the virtual appliances. You register the
virtual appliances with a target group for the Gateway Load Balancer.
Traffic to and from a Gateway Load Balancer endpoint is configured using route tables. Traffic flows from
the service consumer VPC over the Gateway Load Balancer endpoint to the Gateway Load Balancer in
the service provider VPC, and then returns to the service consumer VPC. You must create the Gateway
Load Balancer endpoint and the application servers in different subnets. This enables you to configure
the Gateway Load Balancer endpoint as the next hop in the route table for the application subnet.
For more information, see Access virtual appliances through AWS PrivateLink in the AWS PrivateLink
Guide.
Appliance vendors
You are responsible for choosing and qualifying software from appliance vendors. You must trust the
appliance software to inspect or modify traffic from the load balancer. The appliance vendors listed as
Elastic Load Balancing Partners have integrated and qualified their appliance software with AWS. You
can place a higher degree of trust in the appliance software from vendors in this list. However, AWS does
not guarantee the security or reliability of software from these vendors.
Getting started
To create a Gateway Load Balancer using the AWS Management Console, see Getting started (p. 2).
To create a Gateway Load Balancer using the AWS Command Line Interface, see Getting started using
the CLI (p. 7).
Pricing
With your load balancer, you pay only for what you use. For more information, see Elastic Load Balancing
pricing.
1
Elastic Load Balancing Gateway Load Balancers
Overview
In this tutorial, we'll implement an inspection system using a Gateway Load Balancer and a Gateway
Load Balancer endpoint.
Contents
• Overview (p. 2)
• Prerequisites (p. 4)
• Step 1: Register targets and create a Gateway Load Balancer (p. 4)
• Step 2: Create a Gateway Load Balancer endpoint (p. 5)
• Step 3: Configure routing (p. 6)
Overview
A Gateway Load Balancer endpoint is a VPC endpoint that provides private connectivity between virtual
appliances in the service provider VPC, and application servers in the service consumer VPC. The Gateway
Load Balancer is deployed in the same VPC as that of the virtual appliances. These appliances are
registered as a target group of the Gateway Load Balancer.
The application servers run in one subnet (destination subnet) in the service consumer VPC, while the
Gateway Load Balancer endpoint is in another subnet of the same VPC. All traffic entering the service
consumer VPC through the internet gateway is first routed to the Gateway Load Balancer endpoint for
inspection and then routed to the destination subnet.
Similarly, all traffic leaving the application servers (destination subnet) is routed to the Gateway Load
Balancer endpoint for inspection before it is routed back to the internet. The following network diagram
is a visual representation of how a Gateway Load Balancer endpoint is used to access an endpoint service.
2
Elastic Load Balancing Gateway Load Balancers
Routing
The numbered items that follow, highlight and explain elements shown in the preceding image.
1. Traffic enters the service consumer VPC through the internet gateway.
2. Traffic is sent to the Gateway Load Balancer endpoint, as a result of ingress routing.
3. Traffic is sent to the Gateway Load Balancer for inspection through the security appliance.
4. Traffic is sent back to the Gateway Load Balancer endpoint after inspection.
5. Traffic is sent to the application servers (destination subnet).
1. Traffic is sent to the Gateway Load Balancer endpoint as a result of the default route configured on
the application server subnet.
2. Traffic is sent to the Gateway Load Balancer for inspection through the security appliance.
3. Traffic is sent back to the Gateway Load Balancer endpoint after inspection.
4. Traffic is sent to the internet gateway based on the route table configuration.
5. Traffic is routed back to the internet.
Routing
The route table for the internet gateway must have an entry that routes traffic destined for the
application servers to the Gateway Load Balancer endpoint. To specify the Gateway Load Balancer
endpoint, use the ID of the VPC endpoint.
Destination Target
10.0.0.0/16 Local
3
Elastic Load Balancing Gateway Load Balancers
Prerequisites
Destination Target
10.0.1.0/24 vpc-endpoint-id
The route table for the subnet with the application servers must have an entry that routes all traffic
(0.0.0.0/0) from the application servers to the Gateway Load Balancer endpoint.
Destination Target
10.0.0.0/16 Local
0.0.0.0/0 vpc-endpoint-id
The route table for the subnet with the Gateway Load Balancer endpoint must route traffic that returns
from inspection to its final destination. For traffic that originated from the internet, the local route
ensures that it reaches the application servers. For traffic that originated from the application servers,
add an entry that routes all traffic (0.0.0.0/0) to the internet gateway.
Destination Target
10.0.0.0/16 Local
0.0.0.0/0 internet-gateway-id
Prerequisites
• Ensure that the service consumer VPC has at least two subnets for each Availability Zone that contains
application servers. One subnet is for the Gateway Load Balancer endpoint, and the other is for the
application servers.
• The Gateway Load Balancer and the targets can be in the same subnet.
• You cannot use a subnet that is shared from another account to deploy the Gateway Load Balancer.
• Launch at least one security appliance instance in each security appliance subnet in the service
provider VPC. The security groups for these instances must allow UDP traffic on port 6081.
4
Elastic Load Balancing Gateway Load Balancers
Step 2: Create a Gateway Load Balancer endpoint
5. Protocol must be GENEVE, and Port must be 6081. No other values for Protocol and port are
supported.
6. For VPC, select a virtual private cloud (VPC) with the instances that you want to include in the target
group.
7. For Health checks (optional), modify the health check settings as needed.
8. Expand Tags and add tags (optional).
9. Choose Next.
10. Add one or more targets as follows:
• If the target type is Instances, select one or more instances, enter one or more ports, and then
choose Include as pending below.
• If the target type is IP addresses, select the network, enter the IP address and ports, and then
choose Include as pending below.
11. Choose Create target group.
5
Elastic Load Balancing Gateway Load Balancers
Step 3: Configure routing
d. Choose Create service. Choose the service ID. Save the service name from the Details tab; you'll
need it when you create the endpoint.
e. Choose Actions, Add principals to whitelist. Enter the ARNs of the service consumers that are
allowed to create an endpoint to your service. A service consumer can be an IAM user, IAM role,
or AWS account.
4. In the navigation pane, choose Endpoints.
5. Choose Create Endpoint and do the following:
To configure routing
6
Elastic Load Balancing Gateway Load Balancers
Overview
In this tutorial, we'll implement an inspection system using a Gateway Load Balancer and a Gateway
Load Balancer endpoint.
Contents
• Overview (p. 7)
• Prerequisites (p. 9)
• Step 1: Create a Gateway Load Balancer and register targets (p. 9)
• Step 2: Create a Gateway Load Balancer endpoint (p. 10)
• Step 3: Configure routing (p. 11)
Overview
A Gateway Load Balancer endpoint is a VPC endpoint that provides private connectivity between virtual
appliances in the service provider VPC, and application servers in the the service consumer VPC. The
Gateway Load Balancer is deployed in the same VPC as that of the virtual appliances. These appliances
are registered as a target group of the Gateway Load Balancer.
The application servers run in one subnet (destination subnet) in the service consumer VPC, while the
Gateway Load Balancer endpoint is in another subnet of the same VPC. All traffic entering the service
consumer VPC through the internet gateway is first routed to the Gateway Load Balancer endpoint for
inspection and then routed to the destination subnet.
Similarly, all traffic leaving the application servers (destination subnet) is routed to the Gateway Load
Balancer endpoint for inspection before it is routed back to the internet. The following network diagram
is a visual representation of how a Gateway Load Balancer endpoint is used to access an endpoint service.
7
Elastic Load Balancing Gateway Load Balancers
Routing
The numbered items that follow, highlight and explain elements shown in the preceding image.
1. Traffic enters the service consumer VPC through the internet gateway.
2. Traffic is sent to the Gateway Load Balancer endpoint, as a result of ingress routing.
3. Traffic is sent to the Gateway Load Balancer for inspection through the security appliance.
4. Traffic is sent back to the Gateway Load Balancer endpoint after inspection.
5. Traffic is sent to the application servers (destination subnet).
1. Traffic is sent to the Gateway Load Balancer endpoint as a result of the default route configured on
the application server subnet.
2. Traffic is sent to the Gateway Load Balancer for inspection through the security appliance.
3. Traffic is sent back to the Gateway Load Balancer endpoint after inspection.
4. Traffic is sent to the internet gateway based on the route table configuration.
5. Traffic is routed back to the internet.
Routing
The route table for the internet gateway must have an entry that routes traffic destined for the
application servers to the Gateway Load Balancer endpoint. To specify the Gateway Load Balancer
endpoint, use the ID of the VPC endpoint.
Destination Target
10.0.0.0/16 Local
8
Elastic Load Balancing Gateway Load Balancers
Prerequisites
Destination Target
10.0.1.0/24 vpc-endpoint-id
The route table for the subnet with the application servers must have an entry that routes all traffic
(0.0.0.0/0) from the application servers to the Gateway Load Balancer endpoint.
Destination Target
10.0.0.0/16 Local
0.0.0.0/0 vpc-endpoint-id
The route table for the subnet with the Gateway Load Balancer endpoint must route traffic that returns
from inspection to its final destination. For traffic that originated from the internet, the local route
ensures that it reaches the application servers. For traffic that originated from the application servers,
add an entry that routes all traffic (0.0.0.0/0) to the internet gateway.
Destination Target
10.0.0.0/16 Local
0.0.0.0/0 internet-gateway-id
Prerequisites
• Install the AWS CLI or update to the current version of the AWS CLI if you are using a version that does
not support Gateway Load Balancers. For more information, see Installing the AWS Command Line
Interface in the AWS Command Line Interface User Guide.
• Ensure that the service consumer VPC has at least two subnets for each Availability Zone that contains
application servers. One subnet is for the Gateway Load Balancer endpoint, and the other is for the
application servers.
• Ensure that the service provider VPC has at least two subnets for each Availability Zone that contains
security appliance instances. One subnet is for the Gateway Load Balancer, and the other is for the
instances.
• Launch at least one security appliance instance in each security appliance subnet in the service
provider VPC. The security groups for these instances must allow UDP traffic on port 6081.
1. Use the create-load-balancer command to create a load balancer of type gateway. You can specify
one subnet for each Availability Zone in which you launched security appliance instances.
9
Elastic Load Balancing Gateway Load Balancers
Step 2: Create a Gateway Load Balancer endpoint
The output includes the Amazon Resource Name (ARN) of the load balancer, with the format shown
in the following example.
arn:aws:elasticloadbalancing:us-east-2:123456789012:loadbalancer/gwy/my-load-
balancer/1234567890123456
2. Use the create-target-group command to create a target group, specifying the service provider VPC
in which you launched your instances.
aws elbv2 create-target-group --name my-targets --protocol GENEVE --port 6081 --vpc-
id provider-vpc-id
The output includes the ARN of the target group, with the following format.
arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/my-
targets/0123456789012345
3. Use the register-targets command to register your instances with your target group.
4. Use the create-listener command to create a listener for your load balancer with a default rule that
forwards requests to your target group.
The output contains the ARN of the listener, with the following format.
arn:aws:elasticloadbalancing:us-east-2:123456789012:listener/gwy/my-load-
balancer/1234567890123456/abc1234567890123
5. (Optional) You can verify the health of the registered targets for your target group using the
following describe-target-health command.
10
Elastic Load Balancing Gateway Load Balancers
Step 3: Configure routing
The output contains the service ID (for example, vpce-svc-12345678901234567) and the service
name (for example, com.amazonaws.vpce.us-east-2.vpce-svc-12345678901234567).
2. Use the modify-vpc-endpoint-service-permissions command to allow service consumers to create
an endpoint to your service. A service consumer can be an IAM user, IAM role, or AWS account. The
following example adds permission for the specified AWS account.
3. Use the create-vpc-endpoint command to create the Gateway Load Balancer endpoint for your
service.
The output contains the ID of the Gateway Load Balancer endpoint (for example,
vpce-01234567890abcdef).
To configure routing
1. Use the create-route command to add an entry to the route table for the internet gateway that
routes traffic that's destined for the application servers to the Gateway Load Balancer endpoint.
2. Use the create-route command to add an entry to the route table for the subnet with the
application servers that routes all traffic from the application servers to the Gateway Load Balancer
endpoint.
3. Use the create-route command to add an entry to the route table for the subnet with the Gateway
Load Balancer endpoint that routes all traffic that originated from the application servers to the
internet gateway.
11
Elastic Load Balancing Gateway Load Balancers
Load balancer state
A Gateway Load Balancer operates at the third layer of the Open Systems Interconnection (OSI) model.
It listens for all IP packets across all ports and forwards traffic to the target group that's specified in the
listener rule, using the GENEVE protocol on port 6081.
You can add or remove targets from your load balancer as your needs change, without disrupting the
overall flow of requests. Elastic Load Balancing scales your load balancer as traffic to your application
changes over time. Elastic Load Balancing can scale to the vast majority of workloads automatically.
Contents
• Load balancer state (p. 12)
• Load balancer attributes (p. 12)
• Availability Zones (p. 13)
• Deletion protection (p. 13)
• Cross-zone load balancing (p. 13)
• Create a Gateway Load Balancer (p. 14)
• Tags for your Gateway Load Balancer (p. 16)
• Delete a Gateway Load Balancer (p. 17)
provisioning
The Gateway Load Balancer is fully set up and ready to route traffic.
failed
deletion_protection.enabled
Indicates whether deletion protection (p. 13) is enabled. The default is false.
load_balancing.cross_zone.enabled
Indicates whether cross-zone load balancing (p. 13) is enabled. The default is false.
12
Elastic Load Balancing Gateway Load Balancers
Availability Zones
Availability Zones
When you create a Gateway Load Balancer, you enable one or more Availability Zones, and specify the
subnet that corresponds to each zone. When you enable multiple Availability Zones, it ensures that the
load balancer can continue to route traffic even if an Availability Zone becomes unavailable. The subnets
that you specify must each have at least 8 available IP addresses. Subnets cannot be added or removed
after the load balancer is created. To add or remove a subnet, you must create a new load balancer.
Deletion protection
To prevent your Gateway Load Balancer from being deleted accidentally, you can enable deletion
protection. By default, deletion protection is disabled.
If you enable deletion protection for your Gateway Load Balancer, you must disable it before you can
delete the Gateway Load Balancer.
13
Elastic Load Balancing Gateway Load Balancers
Create a load balancer
Before you begin, ensure that the virtual private cloud (VPC) for your Gateway Load Balancer has at least
one subnet in each Availability Zone where you have targets.
To create a Gateway Load Balancer using the AWS CLI, see Getting started using the CLI (p. 7).
To create a Gateway Load Balancer using the AWS Management Console, complete the following tasks.
Tasks
• Step 1: Configure your target group and register targets (p. 14)
• Step 2: Configure the load balancer and listener (p. 15)
• Important next steps (p. 16)
a. For Choose a target type, select Instances to specify targets by instance ID, or select IP
addresses to specify targets by IP address.
b. For Target group name, enter a name for the target group.
c. Verify that Protocol is set to GENEVE, and the Port is set to 6081. No other values for Protocol
and port are supported.
d. For VPC, select a virtual private cloud (VPC) with the instances that you want to include in your
target group.
5. In the Health checks section (optional), modify the default settings as needed. For Advanced health
check settings, choose the health check port, count, timeout, and interval, and then specify success
14
Elastic Load Balancing Gateway Load Balancers
Step 2: Configure the load balancer and listener
codes. If health checks consecutively exceed the Unhealthy threshold count, the load balancer
takes the target out of service. If health checks consecutively exceed the Healthy threshold count,
the load balancer puts the target back in service. For more information, see Health checks for your
target groups (p. 23).
6. For Tags (optional), add one or more tags as follows:
a. For Load balancer name, enter a name for your load balancer. For example, my-glb. The
name of your Gateway Load Balancer must be unique within your set of load balancers for the
Region. It can have a maximum of 32 characters, can contain only alphanumeric characters and
hyphens, and must not begin or end with a hyphen.
b. For IP address type, you must choose IPv4, because your clients can only use IPv4 addresses to
communicate with the load balancer.
6. Network mapping
a. For VPC, select the service provider VPC. Only VPCs with an internet gateway are available for
selection.
b. For Mappings, select all of the Availability Zones in which you launched security appliance
instances, and the corresponding public subnets.
7. IP listener routing
8. For Default action, select a target group to forward traffic to. If you don't have a default target
group, create a target group first. Only target groups with GENEVE protocol are available for use
with the Gateway Load Balancer.
9. Tag and create
15
Elastic Load Balancing Gateway Load Balancers
Important next steps
a. Add an optional tag to categorize your load balancer. Tag keys must be unique for each load
balancer. Allowed characters are letters, spaces, numbers (in UTF-8), and the following special
characters: + - = . _ : / @. Do not use leading or trailing spaces. Tag values are case-sensitive. For
more information, see Update tags (p. 16).
b. Review your configuration, and choose Create load balancer. A few default attributes are
applied to your load balancer during creation. You can view and edit them after creating the
load balancer.
You can add multiple tags to each load balancer. Tag keys must be unique for each Gateway Load
Balancer. If you add a tag with a key that is already associated with the load balancer, it updates the
value of that tag.
When you are finished with a tag, you can remove it from your Gateway Load Balancer.
Restrictions
To update the tags for a Gateway Load Balancer using the console
16
Elastic Load Balancing Gateway Load Balancers
Delete a load balancer
To update the tags for a Gateway Load Balancer using the AWS CLI
You can't delete a Gateway Load Balancer if it is in use by another service. For example, if the Gateway
Load Balancer is associated with a VPC endpoint service, you must delete the endpoint service
configuration before you can delete the associated Gateway Load Balancer.
Deleting a Gateway Load Balancer also deletes its listeners. Deleting a Gateway Load Balancer does not
affect its registered targets. For example, your EC2 instances continue to run and are still registered to
their target groups. To delete your target groups, see Delete a target group (p. 30).
17
Elastic Load Balancing Gateway Load Balancers
Listeners for Gateway Load Balancers listen for all IP packets across all ports. You cannot specify a
protocol or port when you create a listener for a Gateway Load Balancer. You cannot delete the listener
for a Gateway Load Balancer.
When you create a listener, you specify a rule for routing requests. This rule forwards requests to the
specified target group. You can update the listener rule to forward requests to a different target group.
18
Elastic Load Balancing Gateway Load Balancers
Routing configuration
You define health check settings for your Gateway Load Balancer on a per target group basis. Each
target group uses the default health check settings, unless you override them when you create the target
group or modify them later on. After you specify a target group in a rule for a listener, the Gateway Load
Balancer continually monitors the health of all targets registered with the target group that are in an
Availability Zone enabled for the Gateway Load Balancer. The Gateway Load Balancer routes requests
to the registered targets that are healthy. For more information, see Health checks for your target
groups (p. 23).
Contents
• Routing configuration (p. 19)
• Target type (p. 19)
• Registered targets (p. 20)
• Target group attributes (p. 20)
• Deregistration delay (p. 20)
• Create a target group for your Gateway Load Balancer (p. 21)
• Health checks for your target groups (p. 23)
• Register targets with your target group (p. 27)
• Tags for your target group (p. 29)
• Delete a target group (p. 30)
Routing configuration
Target groups for Gateway Load Balancers support the following protocol and port:
• Protocol: GENEVE
• Port: 6081
Target type
When you create a target group, you specify its target type, which determines how you specify its
targets. After you create a target group, you cannot change its target type.
instance
19
Elastic Load Balancing Gateway Load Balancers
Registered targets
ip
When the target type is ip, you can specify IP addresses from one of the following CIDR blocks:
Important
You can't specify publicly routable IP addresses.
Registered targets
Your Gateway Load Balancer serves as a single point of contact for clients, and distributes incoming
traffic across its healthy registered targets. Each target group must have at least one registered target in
each Availability Zone that is enabled for the Gateway Load Balancer. You can register each target with
one or more target groups.
If demand increases, you can register additional targets with one or more target groups in order to
handle the demand. The Gateway Load Balancer starts routing traffic to a newly registered target as
soon as the registration process completes.
If demand decreases, or you need to service your targets, you can deregister targets from your target
groups. Deregistering a target removes it from your target group, but does not affect the target
otherwise. The Gateway Load Balancer stops routing traffic to a target as soon as it is deregistered. The
target enters the draining state until in-flight requests have completed. You can register the target
with the target group again when you are ready for it to resume receiving traffic.
deregistration_delay.timeout_seconds
The amount of time for Elastic Load Balancing to wait before changing the state of a deregistering
target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.
Deregistration delay
When you deregister a target, the Gateway Load Balancer manages flows to that target in the following
manner:
New flows:
The Gateway Load Balancer stops sending new flows to a deregistered target.
20
Elastic Load Balancing Gateway Load Balancers
Create a target group
Existing flows:
To help drain existing flows, we recommend that you stop sending all traffic to the load balancer. This
allows the idle timeout created by deregistration to take effect. A deregistered target shows that it is
draining until the timeout expires. After the deregistration delay timeout expires, the target transitions
to an unused state.
New console
Old console
To route traffic to the targets in a target group, create a listener and specify the target group in the
default action for the listener. For more information, see Listeners (p. 18).
You can add or remove targets from your target group at any time. For more information, see Register
targets (p. 27). You can also modify the health check settings for your target group. For more
information, see Modify health check settings (p. 26).
21
Elastic Load Balancing Gateway Load Balancers
Create a target group
New console
Old console
22
Elastic Load Balancing Gateway Load Balancers
Configure health checks
Use the create-target-group command to create the target group, the add-tags command to tag your
target group, and the register-targets command to add targets.
The Gateway Load Balancer periodically sends a request to each registered target to check its status.
After each health check is complete, the Gateway Load Balancer closes the connection that was
established for the health check.
Setting Description
23
Elastic Load Balancing Gateway Load Balancers
Target health status
Setting Description
The following table describes the possible values for the health status of a registered target.
Value Description
unhealthy The target did not respond to a health check or failed the
health check.
unused The target is not registered with a target group, the target
group is not used in a listener rule, the target is in an
Availability Zone that is not enabled, or the target is in the
stopped or terminated state.
24
Elastic Load Balancing Gateway Load Balancers
Health check reason codes
Value Description
Related reason code: Elb.InternalError
New flows: New flows are sent to a healthy target. When a load balancing decision for a flow has been
made, the Gateway Load Balancer will send the flow to the same target even if that target becomes
unhealthy, or other targets become healthy.
When all targets are unhealthy, the Gateway Load Balancer picks a target at random and forwards traffic
to it for the life of the flow, until it is either reset or has timed out. Because traffic is being forwarded to
an unhealthy target, traffic is dropped until that target becomes healthy again.
25
Elastic Load Balancing Gateway Load Balancers
Check the health of your targets
Cross-zone load balancing: By default, load balancing across Availability Zones is disabled. If load
balancing across zones is enabled, each Gateway Load Balancer is able to see all targets in all Availability
Zones, and they are all treated the same, regardless of their zone.
Load balancing and health check decisions are always independent among zones. Even when load
balancing across zones is enabled, the behavior for existing flows and new flows is the same as described
above. For more information, see Cross-zone load balancing in the Elastic Load Balancing User Guide.
New console
Old console
Use the describe-target-health command. The output of this command contains the target health state.
It includes a reason code if the status is any value other than Healthy.
Use CloudWatch alarms to trigger a Lambda function to send details about unhealthy targets. For step-
by-step instructions, see the following blog post: Identifying unhealthy targets of your load balancer.
New console
To modify health check settings for a target group using the new console
26
Elastic Load Balancing Gateway Load Balancers
Register targets
3. Choose the name of the target group to open its details page.
4. On the Group details tab, in the Health check settings section, choose Edit.
5. On the Edit health check settings page, modify the settings as needed, and then choose Save
changes.
Old console
To modify health check settings for a target group using the old console
To modify health check settings for a target group using the AWS CLI
If demand on your currently registered targets increases, you can register additional targets in order to
handle the demand. If demand on your registered targets decreases, you can deregister targets from
your target group. It can take a few minutes for the deregistration process to complete and for the
Gateway Load Balancer to stop routing requests to the target. If demand increases subsequently, you can
register targets that you deregistered with the target group again. If you need to service a target, you
can deregister it and then register it again when servicing is complete.
When you deregister a target, Elastic Load Balancing waits until in-flight requests have completed.
This is known as connection draining. The status of a target is draining while connection draining is in
progress. After deregistration is complete, status of the target changes to unused. For more information,
see Deregistration delay (p. 20).
Gateway Load Balancers do not have associated security groups. Therefore, the security groups for your
targets must use IP addresses to allow traffic from the load balancer.
Network ACLs
When you register EC2 instances as targets, you must ensure that the network access control lists
(ACL) for the subnets for your instances allow traffic on port 6081. The default network ACL for a VPC
27
Elastic Load Balancing Gateway Load Balancers
Register or deregister targets
allows all inbound and outbound traffic. If you create custom network ACLs, verify that they allow the
appropriate traffic.
The target type of your target group determines how you register targets with that target group. For
more information, see Target type (p. 19).
Requirements
• You cannot register instances by instance ID if they are in a VPC that is peering to the load balancer
VPC (same Region or different Region). You can register these instances by IP address.
Contents
• Register or deregister targets by instance ID (p. 28)
• Register or deregister targets by IP address (p. 29)
• Register or deregister targets using the AWS CLI (p. 29)
New console
Old console
28
Elastic Load Balancing Gateway Load Balancers
Update tags
New console
Old console
You can add multiple tags to each target group. Tag keys must be unique for each target group. If you
add a tag with a key that is already associated with the target group, it updates the value of that tag.
29
Elastic Load Balancing Gateway Load Balancers
Delete a target group
When you are finished with a tag, you can remove it.
Restrictions
New console
To update the tags for a target group using the new console
Old console
To update the tags for a target group using the old console
To update the tags for a target group using the AWS CLI
30
Elastic Load Balancing Gateway Load Balancers
Delete a target group
New console
Old console
31
Elastic Load Balancing Gateway Load Balancers
CloudWatch metrics
CloudWatch metrics
You can use Amazon CloudWatch to retrieve statistics about data points for your Gateway Load
Balancers and targets as an ordered set of time-series data, known as metrics. You can use these
metrics to verify that your system is performing as expected. For more information, see CloudWatch
metrics for your Gateway Load Balancer (p. 32).
VPC Flow Logs
You can use VPC Flow Logs to capture detailed information about the traffic going to and from your
Gateway Load Balancer. For more information, see VPC flow logs in the Amazon VPC User Guide.
Create a flow log for each network interface for your Gateway Load Balancer. There is one network
interface per subnet. To identify the network interfaces for a Gateway Load Balancer, look for the
name of the Gateway Load Balancer in the description field of the network interface.
There are two entries for each connection through your Gateway Load Balancer, one for the frontend
connection between the client and the Gateway Load Balancer, and the other for the backend
connection between the Gateway Load Balancer and the target. If the target is registered by instance
ID, the connection appears to the instance as a connection from the client. If the security group of
the instance doesn't allow connections from the client but the network ACLs for the subnet allow
them, the logs for the network interface for the Gateway Load Balancer show "ACCEPT OK" for the
frontend and backend connections, while the logs for the network interface for the instance show
"REJECT OK" for the connection.
CloudTrail logs
You can use AWS CloudTrail to capture detailed information about the calls made to the Elastic
Load Balancing API, and store them as log files in Amazon S3. You can use these CloudTrail logs
to determine which calls were made, the source IP address where the call came from, who made
the call, when the call was made, and so on. For more information, see Logging API calls for your
Gateway Load Balancer using AWS CloudTrail (p. 36).
32
Elastic Load Balancing Gateway Load Balancers
Gateway Load Balancer metrics
of time-series data, known as metrics. Think of a metric as a variable to monitor, and the data points as
the values of that variable over time. For example, you can monitor the total number of healthy targets
for a Gateway Load Balancer over a specified time period. Each data point has an associated time stamp
and an optional unit of measurement.
You can use metrics to verify that your system is performing as expected. For example, you can create a
CloudWatch alarm to monitor a specified metric and initiate an action (such as sending a notification to
an email address) if the metric goes outside of what you consider an acceptable range.
Elastic Load Balancing reports metrics to CloudWatch only when requests are flowing through the
Gateway Load Balancer. If there are requests flowing, Elastic Load Balancing measures and sends its
metrics in 60-second intervals. If there are no requests flowing or no data for a metric, the metric is not
reported.
Contents
• Gateway Load Balancer metrics (p. 33)
• Metric dimensions for Gateway Load Balancers (p. 34)
• View CloudWatch metrics for your Gateway Load Balancer (p. 35)
Metric Description
ActiveFlowCount The total number of concurrent flows (or connections) from clients to
targets.
Dimensions
• LoadBalancer
• AvailabilityZone, LoadBalancer
ConsumedLCUs The number of load balancer capacity units (LCU) used by your load
balancer. You pay for the number of LCUs that you use per hour. For
more information, see Elastic Load Balancing Pricing.
Statistics: All
Dimensions
• LoadBalancer
33
Elastic Load Balancing Gateway Load Balancers
Metric dimensions for Gateway Load Balancers
Metric Description
Dimensions
• LoadBalancer, TargetGroup
• AvailabilityZone, LoadBalancer, TargetGroup
NewFlowCount The total number of new flows (or connections) established from clients
to targets in the time period.
Dimensions
• LoadBalancer
• AvailabilityZone, LoadBalancer
ProcessedBytes The total number of bytes processed by the load balancer. This count
includes traffic to and from targets, but not health check traffic.
Dimensions
• LoadBalancer
• AvailabilityZone, LoadBalancer
Dimensions
• LoadBalancer, TargetGroup
• AvailabilityZone, LoadBalancer, TargetGroup
Dimension Description
LoadBalancer Filters the metric data by Gateway Load Balancer. Specify the Gateway Load
Balancer as follows: gateway/load-balancer-name/1234567890123456 (the
final portion of the ARN).
TargetGroup Filters the metric data by target group. Specify the target group as follows:
targetgroup/target-group-name/1234567890123456 (the final portion of
the target group ARN).
34
Elastic Load Balancing Gateway Load Balancers
View CloudWatch metrics for your Gateway Load Balancer
Alternatively, you can view metrics for your Gateway Load Balancer using the CloudWatch console.
Use the following get-metric-statistics command get statistics for the specified metric and dimension.
Note that CloudWatch treats each unique combination of dimensions as a separate metric. You can't
retrieve statistics using combinations of dimensions that were not specially published. You must specify
the same dimensions that were used when the metrics were created.
35
Elastic Load Balancing Gateway Load Balancers
CloudTrail logs
{
"Datapoints": [
{
"Timestamp": "2020-12-18T22:00:00Z",
"Average": 0.0,
"Unit": "Count"
},
{
"Timestamp": "2020-12-18T04:00:00Z",
"Average": 0.0,
"Unit": "Count"
},
...
],
"Label": "UnHealthyHostCount"
}
To learn more about CloudTrail, see the AWS CloudTrail User Guide.
For an ongoing record of events in your AWS account, including events for Elastic Load Balancing, create
a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create
a trail in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the
AWS partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can
configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs.
For more information, see the following:
36
Elastic Load Balancing Gateway Load Balancers
Understanding Elastic Load Balancing log file entries
All Elastic Load Balancing actions for Gateway Load Balancers are logged by CloudTrail and are
documented in the Elastic Load Balancing API Reference version 2015-12-01. For example, calls to the
CreateLoadBalancer and DeleteLoadBalancer actions generate entries in the CloudTrail log files.
Every event or log entry contains information about who generated the request. The identity
information helps you determine the following:
• Whether the request was made with root or AWS Identity and Access Management (IAM) user
credentials.
• Whether the request was made with temporary security credentials for a role or federated user.
• Whether the request was made by another AWS service.
The log files include events for all AWS API calls for your AWS account, not just Elastic Load Balancing
API calls. You can locate calls to the Elastic Load Balancing API by checking for eventSource elements
with the value elasticloadbalancing.amazonaws.com. To view a record for a specific action, such
as CreateLoadBalancer, check for eventName elements with the action name.
The following are example CloudTrail log records for Elastic Load Balancing for a user who created
a Gateway Load Balancer and then deleted it using the AWS CLI. You can identify the CLI using the
userAgent elements. You can identify the requested API calls using the eventName elements.
Information about the user (Alice) can be found in the userIdentity element.
{
"eventVersion": "1.03",
"userIdentity": {
"type": "IAMUser",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "Alice"
},
"eventTime": "2020-12-11T15:31:48Z",
"eventSource": "elasticloadbalancing.amazonaws.com",
"eventName": "CreateLoadBalancer",
"awsRegion": "us-west-2",
"sourceIPAddress": "198.51.100.1",
"userAgent": "aws-cli/1.10.10 Python/2.7.9 Windows/7 botocore/1.4.1",
"requestParameters": {
"subnets": ["subnet-8360a9e7","subnet-b7d581c0"],
"name": "my-load-balancer",
"type": "gateway"
},
"responseElements": {
"loadBalancers":[{
"type": "gateway",
"loadBalancerName": "my-load-balancer",
37
Elastic Load Balancing Gateway Load Balancers
Understanding Elastic Load Balancing log file entries
"vpcId": "vpc-3ac0fb5f",
"state": {"code":"provisioning"},
"availabilityZones": [
{"subnetId":"subnet-8360a9e7","zoneName":"us-west-2a"},
{"subnetId":"subnet-b7d581c0","zoneName":"us-west-2b"}
],
"createdTime": "Dec 11, 2020 5:23:50 PM",
"loadBalancerArn": "arn:aws:elasticloadbalancing:us-
west-2:123456789012:loadbalancer/gateway/my-load-balancer/ffcddace1759e1d0",
}]
},
"requestID": "b9960276-b9b2-11e3-8a13-f1ef1EXAMPLE",
"eventID": "6f4ab5bd-2daa-4d00-be14-d92efEXAMPLE",
"eventType": "AwsApiCall",
"apiVersion": "2015-12-01",
"recipientAccountId": "123456789012"
}
{
"eventVersion": "1.03",
"userIdentity": {
"type": "IAMUser",
"principalId": "123456789012",
"arn": "arn:aws:iam::123456789012:user/Alice",
"accountId": "123456789012",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"userName": "Alice"
},
"eventTime": "2020-12-12T15:31:48Z",
"eventSource": "elasticloadbalancing.amazonaws.com",
"eventName": "DeleteLoadBalancer",
"awsRegion": "us-west-2",
"sourceIPAddress": "198.51.100.1",
"userAgent": "aws-cli/1.10.10 Python/2.7.9 Windows/7 botocore/1.4.1",
"requestParameters": {
"loadBalancerArn": "arn:aws:elasticloadbalancing:us-
west-2:123456789012:loadbalancer/gateway/my-load-balancer/ffcddace1759e1d0"
},
"responseElements": null,
"requestID": "349598b3-000e-11e6-a82b-298133eEXAMPLE",
"eventID": "75e81c95-4012-421f-a0cf-babdaEXAMPLE",
"eventType": "AwsApiCall",
"apiVersion": "2015-12-01",
"recipientAccountId": "123456789012"
}
38
Elastic Load Balancing Gateway Load Balancers
Load balancers
Your AWS account has the following quotas related to Gateway Load Balancers.
* Each Gateway Load Balancer uses one network interface per zone.
Target groups
39
Elastic Load Balancing Gateway Load Balancers
Initial release (p. 40) This release of Elastic Load November 10, 2020
Balancing introduces Gateway
Load Balancers.
40