Application load balancers#

General information#

Application load balancers distribute inbound HTTP and HTTPS traffic among virtual machines for even load distribution among applications. Traffic is distributed using the round-robin algorithm.

To determine what actions to perform and where to forward the traffic, the application load balancers use the rules. Once the balancer gets a request, the listener checks the rules in order of priority to determine which one to apply. The rules help configure routing to various target groups, forwarding to another URL, or providing a fixed HTTP response, depending on the specified conditions.

TLS/SSL certificates#

To connect to the load balancer, the client can use the HTTP/2 or HTTP/1.1 protocol (if necessary, HTTP/2 support can be disabled via the API). To terminate HTTPS connections, the load balancer uses TLS/SSL server certificates in X.509 format. TLS 1.0–1.3 protocols are supported to establish a secure connection.

The WebSocket protocol is supported by default. No additional load balancer configuration is required to use it. However, the application must be able to handle WebSocket traffic on the server side.

When the load balancer receives an HTTP/1.1 request with the Upgrade: websocket header or an HTTP/2 CONNECT request with the :protocol: websocket pseudo-header, it automatically recognizes the WebSocket session and routes the traffic to the appropriate target group. This enables bidirectional communication between the client and the application.

A domain name in the certificate should match the one in the DNS record. It can be FQDN , a short domain name (e.g. example.com), or wildcard name (*.example.com) to protect several subdomains within one domain.

Attention

Certificates have a limited validity period, so they should be renewed in time.

Load balancer decrypts inbound traffic before forwarding it to the target. If the target awaits unencrypted traffic, use a network load balancer with a listener on port 443.

Let’s Encrypt certificates#

A Let’s Encrypt certificate is automatically issued for each internet-facing application load balancer. The certificate is issued for the load balancer domain name in the system domain when a listener is created (unless another certificate is explicitly specified) and is selected as the default certificate for this listener.

You can associate the load balancer with your own domain and request a Let’s Encrypt certificate for this load balancer domain name. The certificate is automatically renewed until the load balancer is deleted.

Let’s Encrypt certificates are valid for 90 days and are renewed 30 days before they expire. You can view them in the IAM certificate store. After renewal, the new certificate replaces the existing one in IAM.

X-Forwarded headers#

The application load balancer automatically adds the following X-Forwarded headers to client request headers:

X-Forwarded-For header#

When forwarding a request to a target (server), the application load balancer replaces the client address with its own. The X-Forwarded-For header allows you to identify the client address when using HTTP and HTTPS listeners.

If the original request does not contain the X-Forwarded-For header, the listener adds it to the request and specifies the client address as the header value. If the X-Forwarded-For header is present, the listener appends the client address to the header, separated by a comma.

X-Forwarded-Proto header#

The protocol the client used to connect to the load balancer may differ from the protocol the load balancer used to connect to the target, because the load balancer establishes a new connection with the target (backend server).

Sometimes the server may need to know which protocol (HTTP or HTTPS) the client used to connect to the load balancer. For example, your application or website may rely on this information when generating a response to an HTTP request in order to redirect it to the appropriate URL.

The load balancer writes the protocol used by the client to the X-Forwarded-Proto header.

X-Forwarded-Port header#

The port the client used to connect to the load balancer may differ from the port the load balancer specified when connecting to the target. The load balancer writes the port used by the client to the X-Forwarded-Port header.

Billing#

Starting from 01.05.2026, an hourly fee is charged for newly created application load balancers. Load balancers created before this date are not billed.

The service price depends on the amount of compute resources actually used by each load balancer. The amount of used resources is defined as the amount of work performed by the balancer (Load balancer Capacity Unit, LCU). The LCU value is calculated based as the maximum of one of the following metrics and is determined for each hour.

  • maximum number of connections per second (CPS): 200;

  • maximum number of requests per second (RPS): 1,000;

  • maximum number of simultaneous connections: 3,000;

  • the total amount of processed data (inbound and outbound data through the load balancer): 90 GiB (90 * 10243 bytes).

The minimum rate is 2 LCUs per availability zone containing the load balancer’s network interfaces, even when there is no load. The final rate is calculated using the formula:

\[\text{Final rate} = max(\text{Calculation result}, 2\,LCU * N_{az})\]

where:

  • \(\text{Final rate}\) — final rate (the maximum of the two values below);

  • \(\text{Calculation result}\) — actual LCU value based on the calculation results;

  • \(2\,LCU * N_{az}\) — minimum rate (2 LCUs per balancer’s availability zone).

Calculation example#

The maximum values of metrics during the calculation hour were:

  • 150 connections per second (CPS);

  • 1,000 requests per second (RPS);

  • 500 active (simultaneous) connections;

  • 540 GiB — the total amount of processed data (inbound and outbound data going through the balancer).

The LCU value for each metric is:

  • 150 CPS / 200 CPS = 0.75 LCU;

  • 1000 RPS / 1000 RPS = 1 LCU;

  • 500 active connections / 3,000 active connections = 0.16(6) LCU;

  • 540 GiB / 90 GiB = 6 LCU.

The ALB has network interfaces in two availability zones.

The minimum rate is 4 LCUs (2 availability zones with 2 LCUs per zone). In this calculation, the maximum LCU value (6 LCUs for the amount of processed data) exceeds the minimum rate. Therefore, the application load balancer service is charged at 6 LCUs for the hour in question.

Note

When using an Internet-facing load balancer, both Internet traffic and Elastic IP addresses are charged.

Load balancer operations#

For a load balancer to operate, in addition to the load balancer itself, you should create at least one listener and an associated target group with at least one resource. Listeners and target groups can be created together with a load balancer. However, it is more convenient to create target groups separately. You can add listeners after the load balancer has been created.

Create an application load balancer#

Note

You can also create a balancer and associate it with an existing target group in the Target groups subsection.

Note

Load balancing across availability zones is always enabled at the load balancer level and cannot be disabled. HTTP/2 support between the client and the load balancer is also enabled by default. If necessary, you can disable it after creating the load balancer. In that case, only HTTP/1.1 will be used.

To create an application load balancer:

  1. Go to the section Load balancing Load balancers and click Create.

  2. Set the basic parameters of the balancer:

    • Type — Type of the load balancer. Select ALB.

    • Name tag — Optional description of the load balancer.

    • Load balancer name — The name must not be longer than 32 characters, can only contain Latin letters, numbers and hyphens, and must not start or end with a hyphen.

    • Scheme — This parameter defines which clients the load balancer can work with. If the Internal scheme is selected, the load balancer handles requests to internal addresses only from clients in the same VPC. If the Internet-facing scheme is selected, the load balancer can distribute requests to external addresses from any clients in the Internet.

    To go to the next step, click Next.

  3. Specify the network mapping parameters:

    • VPC — VPC in which the load balancer will be placed. All other balancer components, such as target groups and targets, must be placed in the same VPC.

      Note

      An internet-facing load balancer can be created only in a VPC with an attached internet gateway.

      If the region has multiple availability zones, you can create a load balancer network interface in each of them.

      • Elastic IP in each availability zone — (Only for an internet-facing load balancer) If you select Shared, it is sufficient to specify one shared public IP address for the load balancer; if you select Individual, you will need to specify an Elastic IP address for a network interface of the load balancer in each availability zone where the balancer is present.

    • Subnet — Subnet in which the network interface of the load balancer will be created.

    • Elastic IP or Private IP — IP address that will be associated with the network interface, depending on the selected scheme. When the internet-facing scheme is selected, an Elastic IP address must be provided. You can also leave this field blank, then the address will be provided automatically. When the internal scheme is selected, a private IP address is provided automatically.

    To associate the load balancer with subnets in other availability zones (if the region has more than one availability zone), click Add subnet and specify the subnet and, if necessary, the IP address. If the Shared option is selected for an internet-facing load balancer, specify the subnet only.

    To go to the next step, click Next.

  4. Add listeners and associate target groups with them. You may skip this step and add listeners later.

    • Name tag — Name or description of the listener.

    • Protocol — Protocol whose traffic the listener accepts (HTTP or HTTPS). If you select HTTPS and leave the Certificate field empty, a Let’s Encrypt certificate is issued automatically. You can specify your own default certificate (see more about certificates). In this case, a Let’s Encrypt certificate for the load balancer domain will not be issued.

    • Port — Port which the listener receives traffic at.

    • Forwarding to — This option allows you to associate a target group with the listener. You can select an existing target group from the list or add a new target group. In the latter case, specify:

      • target group name;

      • port to which traffic is forwarded;

      • targets that are included in the group.

      Note

      Targets must be in the same availability zones as the subnets selected in the previous step.

    To add a listener, click Add.

    If necessary, you can add more listeners right away by repeating the steps above, or you can remove unnecessary ones by clicking Remove.

    To go to the next step, click Next.

  5. If required, assign tags to the load balancer.

    • If the Name tag was not specified in step 2 and you want to add it, click Add Name tag and set the tag value.

    • To add an arbitrary tag, click Add tag and enter tag key and value.

    You can skip this step and add tags later. To go to the next step, click Overview and create.

  6. Check balancer settings. If you need to change any of them, go back to the corresponding step. If everything is OK, click Create to create the balancer.

It may take some time for the balancer to check health of the targets (if those are specified). The health check duration depends on the health check settings for the target groups.

Note

To start the balancer, you need to specify neither a listener nor targets. However, if those are not specified, the balancer will not handle traffic, even when in the Active state.

Map subnet#

When a subnet is mapped to a balancer, a network interface is created in this subnet. The mapped subnet and corresponding interface can be neither changed nor deleted. However, you can map the load balancer to subnets from those availability zones where the load balancer does not have a network interface yet.

To add a subnet:

  1. Go to the section Load balancing Load balancers.

  2. Select the load balancer from the table and click Associate subnets.

  3. Specify the network mapping parameters:

    • Elastic IP in each availability zone — (Only for an internet-facing load balancer) If you select Shared, the load balancer uses one shared Elastic IP address; if you select Separate, an Elastic IP address is associated with a network interface of the load balancer in each availability zone where the balancer is present.

      Important

      The options are available if only one subnet is associated with the load balancer and an Elastic IP address is not assigned automatically.

    • Subnet — Subnet in which an additional network interface of the load balancer will be created. It must be in the same VPC as the already associated subnets.

    • Elastic IP or Private IP — The IP address to be associated with the network interface, depending on the selected scheme. If you select the internet-facing scheme, associate an Elastic IP address. You can leave this field empty, and the address will be associated automatically. If you select the internal scheme, the private IP address is associated automatically.

    To map other subnets to the balancer, click Add subnet.

  4. To map subnets, click Map.

Alternatively, you can associate a subnet on the load balancer page in the Information tab.

Modify load balancer attributes#

You can enable or disable HTTP/2 support between the client and the load balancer. If it is disabled, the client can connect using HTTP/1.1 only.

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the load balancer whose attributes you want to modify and click its name to open its page.

  3. Open the Attributes tab.

  4. To configure the attribute, click Modify.

  5. In the window that opens, set the HTTP/2 switch to the required position.

  6. Click Save.

Set tags for a load balancer#

To add, modify or delete load balancer tags:

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the load balancer for which tags should be edited and click on the balancer name to go to its page.

  3. Open the Tags tab.

  4. To add a tag, click Add tag and specify the Key and Value fields.

    To modify a tag, edit the required fields (Value and/or Key) of the respective tag.

    To delete a tag, click the icon next to the tag you no longer need.

    Note

    If no tags have been set earlier, you can add the Name tag by clicking Add Name tag and specifying its value.

    Note

    You can also modify the Name tag in the Information tab by editing the corresponding field.

  5. Click Apply to save the changes.

Delete load balancer#

Together with the balancer, all listeners belonging to it are deleted. However, deleting a balancer does not affect the associated target groups and their targets.

To delete a load balancer:

  1. Go to the section Load balancing Load balancers.

  2. Select the load balancer from the table and click Delete.

  3. Confirm the action.

You can also delete the load balancer on its page in the Information tab.

Listener operations#

Add listener#

Note

You can also add a listener for the target group in the Target groups subsection.

If no HTTPS listener has been created yet, then when you create one, a Let’s Encrypt certificate will be issued automatically and set as the default certificate. You can specify your own default certificate (see more about certificates). In this case, a Let’s Encrypt certificate for the load balancer domain will not be issued.

Note

If a Let’s Encrypt certificate was not issued when previous HTTPS listeners were created, you can trigger its issuance by leaving the Certificate field empty.

To add a listener:

  1. Go to the section Load balancing Load balancers.

  2. Select the load balancer from the table and click Add listener.

  3. Add listeners and associate target groups with them. To do this, specify the following parameters:

    • Name tag — (Optional) Listener name.

    • Protocol — Protocol whose traffic is to be received by the listener (HTTP or HTTPS).

    • Default certificate — (HTTPS only) The certificate used by default.

    • Port — Port which the listener receives traffic at.

    • Forward to – This option allows you to bind a target group to the listener.

      Select an already existing target group from the list or add a new target group. In the latter case, specify the target group name, the port where traffic is routed to, and the targets that belong to the group.

  4. If you want to assign tags to the listener, click Add tags to go to the next step.

    • If the Name tag was not specified in step 3 and you want to add it, click Add Name tag and set the tag value.

    • To add an arbitrary tag, click Add tag and enter tag key and value.

  5. To add a listener, click Add.

If you need to add more listeners, repeat the above steps.

Alternatively, you can add a listener on the load balancer page in the Listeners tab.

Note

By default, the created listener forwards traffic to the specified target group. You can add other rules to route inbound traffic.

Modify listener settings#

Unlike the balancer creation wizard or the listener adding dialog, you cannot create a target group when modifying listener settings. If you want a listener to redirect traffic to a new target group, create it first.

Note

If a Let’s Encrypt certificate for the load balancer domain has not been issued before, you can trigger its issuance by leaving the Certificate field empty.

To change the listener settings:

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the load balancer to which the listener belongs and click on the load balancer name to go to its page.

  3. Open the Listeners tab and click Modify.

  4. Change the listener settings you need:

    • Protocol — Protocol whose traffic is to be received by the listener.

    • Default certificate — (HTTPS only) The certificate used by default. When selecting a new certificate, specify whether to keep the current certificate as an additional one. For details on additional certificates, see the instructions on replacing the default certificate.

    • Port — Port which the listener receives traffic at.

    • Forwarding to — Target group to which the listener will forward traffic.

  5. To apply settings, click Change.

Request a Let’s Encrypt certificate#

If you have configured your own domain for an internet-facing load balancer, you can entrust the cloud with managing the issuance of Let’s Encrypt certificates. To do this, submit a request via the cloud web interface (see the instructions below).

Note

Let’s Encrypt certificates for the load balancer domain name in the system domain will continue to be renewed.

To issue a certificate for the example.com (or *.example.com) domain, create a DNS record of the following form:

_acme-challenge.example.com CNAME _acme-challenge.<lb-name>-<lb-id>.lb.<region>.k2.cloud

If the certificate is assigned to at least one listener, it will be automatically renewed every 90 days until this record is changed or deleted or the load balancer itself is deleted. In that case, only the certificate renewal stops; the certificate itself is not deleted.

To request a Let’s Encrypt certificate for your domain and assign it to existing listeners:

  1. Go to Load balancing Load balancers and click Request certificate.

  2. In the window that opens, fill in the following fields:

    • Load balancer — The load balancer for which the certificate is requested.

    • Certificate name — An arbitrary certificate name.

    • Domain — The custom domain to which the load balancer is bound.

    • Allow wildcard — The checkbox allows you to use a wildcard character when specifying the domain.

  3. To submit the request, click Request.

  4. Wait for the certificate to be issued (this usually takes 10–15 seconds) to proceed to the next step.

  5. Select the listeners (if any) to which the certificate should be assigned. You can assign the issued certificate as the default certificate, as an additional certificate, or as both. When replacing the default certificate, you can keep the previous certificate as an additional one by selecting the Save the previous certificate as an additional one option.

  6. To assign the certificates, click Assign. To skip assigning the certificates, click Close.

You can also request a certificate on the application load balancer page. To do this, in the Information tab, click Request certificate and follow the instructions above (you do not need to specify the load balancer).

Add certificate#

Note

This feature is only available for HTTPS listeners.

Important

The user should have permissions to work with certificates. If the user is not an IAM administrator, then assign policy IAMServerCertificateAccess to the user.

Once the listener is created, you can add extra certificates besides the default one, so as to support multiple domains on a single port and provide a different certificate for each domain.

The default certificate is used if the domain name does not match any of the additional certificates or if the client connects without using the SNI (Server Name Indication) protocol. You can add it to the list of additional certificates so that it continues to be used to identify the domain even after it is replaced with another default certificate. If an additional certificate is set as the default one, it remains in the list of additional certificates. You can change the default certificate for a specific listener on its page, see how to replace the default certificate.

You can add multiple certificates at the same time. Certificates should be imported to be added.

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the application load balancer to which the HTTPS traffic listener belongs and click on the load balancer name to go to its page.

  3. Open the Listeners tab, find the listener in the resource table, and click the Protocol:Port field to go to the listener page.

  4. Open the Additional certificates tab and click Add.

  5. In the window that opens, select required certificates from the drop-down list.

  6. To complete the action, click Add.

Replace the default certificate#

Note

This feature is only available for HTTPS listeners.

When replacing the default certificate, you can keep the previous certificate as an additional one. To do this, the Save the previous certificate as an additional one checkbox must be selected during the replacement. If the certificate you replace is already among the additional ones, the list does not change. The total number of load balancer certificates, including default and additional certificates, cannot exceed the corresponding quota.

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the application load balancer to which the HTTPS traffic listener belongs and click on the load balancer name to go to its page.

  3. Open the Listeners tab, find the listener in the resource table, and click the Protocol:Port field to go to the listener page.

  4. Click Change default certificate.

  5. Select a new default certificate. To prevent the previous certificate from being kept as an additional one, clear the Keep the previous certificate as an additional one checkbox. If the previous certificate was saved as an additional one earlier, it remains in the list of additional certificates regardless of this checkbox.

  6. Click Modify.

Delete certificate#

Note

The default certificate cannot be deleted.

If you remove a certificate from the listener, it remains available for adding (you can view all available certificates in IAM Certificates).

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the application load balancer to which the HTTPS traffic listener belongs and click on the load balancer name to go to its page.

  3. Open the Listeners tab, find the listener in the resource table, and click the Protocol:Port field to go to the listener page.

  4. Open the Additional certificates tab, select the certificates you no longer need, and click Remove on the action bar.

  5. To confirm the deletion, click Delete in the window that opens.

Configure listener attributes#

Attributes allow you to configure the HTTP headers that the listener adds to HTTP responses. By default, no headers are added to responses. For a description of the supported attributes, see the API documentation.

To configure attributes:

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the load balancer to which the listener belongs and click on the load balancer name to go to its page.

  3. Open the Listeners tab and click the protocol and port combination used by the listener to open its page.

  4. On the Attributes tab, click Modify.

  5. To add a header to the response, enable the corresponding attribute in the Response headers section of the window that opens and specify the header value. To omit the header from the response, disable the switch.

    To add custom headers, click Add header in the Custom headers section and enter the header name and value. If the target response already contains this header, it will be overwritten.

  6. Once you have made all the required modifications, click Save.

Customize tags for a listener#

To add, modify or delete EKS listener tags:

  1. Go to the section Load balancing Load balancers.

  2. In the resource table, find the load balancer to which the listener belongs and click on the load balancer name to go to its page.

  3. Open the Listeners tab, select the listener in the resource table and click on:bdg-light:Customize tags.

  4. To add a tag, click Add tag and specify the Key and Value fields.

    To modify a tag, edit the required fields (Value and/or Key) of the respective tag.

    To delete a tag, click the icon next to the tag you no longer need.

    Note

    If no tags have been set earlier, you can add the Name tag by clicking Add Name tag and specifying its value.

  5. Click Apply to save the changes.

Alternatively, you can set tags on the listener page in the Tags tab.

Delete listener#

Deleting a listener does not affect the associated target group or its targets. After deleting a listener, you can associate the released target group with another listener, including the one belonging to another load balancer.

  1. Go to the section Load balancing Load balancers.

  2. Click the load balancer name to go to its page and open the Listeners tab.

  3. Select the listener from the table and click Delete.

  4. Confirm the action.

Elastic IP can also be deleted on its page in the Information tab.

Listener rules#

You can set your own rules for the listener. They determine further routing of requests that the load balancer recieves. They also describe actions to be performed when the conditions specified in the rules are met. The conditions of the highest-priority rule are checked first (the lower the priority value, the higher the priority is). If they are not met, then the conditions of the next rule are checked, and so on.

Together with the listener, a default rule is created to forward requests to the bound target group. This rule has the lowest priority and, if there are other rules, is triggered only if the conditions for any other rule have not been met. The default rule cannot be changed or deleted.

The rules are subject to the following constraints:

  • up to 100 rules per application load balancer;

  • one condition of each type per rule;

  • up to 5 values across all condition types in one rule;

  • up to 5 target groups per rule with Forward to action;

  • one transformation of each type per rule;

  • up to 9 capture groups in a regular expression;

  • maximum priority up to 49999.

Available actions#

Listener rules support the following actions:

  • Forward to — Requests are forwarded to the specified target groups.

  • Redirect — Requests are redirected to a different URL.

  • Fixed response — A predefined HTTP response is returned to the client receives .

Forwarding#

Inbound requests are distributed across one or more target groups according to the specified weight. For example, if two groups have the same weight, each group will receive exactly half of the requests. If one group has a weight of 10 and the other group has a weight of 5, the first group will receive twice as many requests. The maximum possible weight of a group is 256.

Redirecting#

Inbound requests are redirected to another URL. Redirection can be configured as temporary (HTTP 302 — Found) or permanent (HTTP 301 — Moved Permanently).

URL consists of the following components:

<protocol>://<hostname>:<port>/<path>?<request>
  • protocol — HTTP and HTTPS can be used for redirection.

  • hostname — The hostname is case-insensitive. It can contain Latin letters, digits, hyphens, dots, underscores, and the * wildcard. The total number of characters must be at least 3 and at most 256.

  • port — Valid values from 1 to 65535.

  • path — The absolute case-sensitive path should be specified. The path must begin with a slash / and may contain Latin letters, numbers, hyphens, wildcard characters (* and ?) and special characters _-.$/~~"'@:+. The total number of characters is no more than 128.

  • request — The total number of characters in the request is no more than 128.

To avoid looping, change at least one of the first four components: protocol, hostname, port, or path. To reuse the components of the source URL, specify the following keywords instead:

  • #{protocol} to use the protocol of the source URL;

  • #{host} to use the hostname from the source URL;

  • #{port} to use the port of the source URL;

  • #{path} to use the path from the source URL;

  • #{query} to use the request text from the source URL.

In the dialog, specify the protocol, port, and response code. (Optional) Specify the host, path, and query in the Additional parameters section. To expand the section, click Other host, path, query.

Fixed response#

Incoming requests are discarded, and a predefined response is returned to the client. To configure this action, you may specify a response code (2xx, 4xx, or 5xx), select content type (application/javascript, application/json, text/css, text/html, text/plain), and add an arbitrary message.

Condition types#

You can specify the following condition types in rules:

  • Hostheader — The request is routed based on the specified hostname.

  • Path patterns — The request is routed based on the specified path.

  • Source address — The request is routed based on the specified source IP addresses.

Each condition type can be added only once. You can specify a total of 5 conditions (condition values) across all condition types in each rule.

Values of the same type are combined using the OR logical operator, while conditions of different types are combined using the AND logical operator. For example, you can specify 3 source addresses or networks and 2 path patterns. The logical expression may look as follows:

(192.0.2.0/24 OR 198.51.100.0/24 OR 203.0.113.0/24) AND (/api/v1 OR /api/v2)

Host header#

The rule is selected when the hostname in the URL matches the hostname in the condition. Therefore, a single load balancer can support multiple subdomains and different top-level domains.

The condition value (the domain name specified in the condition) can contain Latin letters, numbers, hyphens, periods, underscores, and wildcard character *. The domain name should contain at least two labels (have at least one dot), while the domain label after the last dot may contain only letters. The total number of characters is at least 3 but not more than 256.

Path patterns#

This condition defines routing rules when the path in the URL matches the path template in the condition. It is only checked against the path specified in the URL; request parameters are not used for comparison.

The condition value (the path template in the condition) is case sensitive. It can contain Latin letters, numbers, wildcard characters (* and ?) and special characters _-.$/~"'@:+. The total number of characters is no more than 128.

Source address#

This condition defines routing rules for cases where the source IP address matches an address or network specified in the condition. If the client is behind a proxy server, the server’s IP address is used for comparison instead of the client’s IP address.

You can specify multiple IP addresses or networks in CIDR notation.

Transformations#

A transformation changes the Host header or HTTP request path using a regular expression. It is applied to a request that matches the rule before the request is sent to the target. The destination address does not change.

A transformation can be configured only for the Forward action. The replacement is specified using a regular expression and a replacement string.

Two transformation types are available:

  • Host header rewrite — Replaces the value of the Host header.

  • URL rewrite — Replaces the request path.

A rule can contain only one transformation of each type. A regular expression may contain only non-space ASCII characters. A single expression can contain no more than 9 capture groups.

For the host app.example.com, the expression ^(.*)\.example\.com$ and replacement $1.internal.example.com produce app.internal.example.com. For the path /api/v1, the expression ^/api/(.*)$ and replacement /$1 produce /v1.

Set the rule#

  1. Go to the section Load balancing Load balancers.

  2. Click the load balancer name to go to its page and open the Listeners tab.

  3. Click on the Protocol:Port field of the desired listener to go to its page.

  4. Open the Rules tab and click Add.

  5. In the window that opens, select Condition type and set the conditions in Condition values field. Click Add to add the conditions. If necessary, set conditions of a different type. Once all conditions have been set, click Next to proceed to the next step.

  6. Select the action to be performed when the rule conditions are met (see supported actions for details).

    Select one or more target groups and specify their weights.

    Click Next to proceed to the next step.

    Specify the protocol, port, and response code.

    (Optional) To specify a host, path, or query, click Other host, path, query. In the Additional parameters section, fill in the Host, Path, and Query fields. If you retain the default values #{host}, /#{path}, and #{query}, the corresponding parts of the original URL will be substituted for them.

    Click Next to proceed to setting the priority.

    Specify the response code, select the message format (Content type), and enter the message (Response body).

    Click Next to proceed to setting the priority.

  7. (Optional) Configure transformations.

    Note

    This step is available only for the Forward action.

    Select the Transformation type, specify the Regular expression and Replacement, and click Add. For details, see transformations.

    Click Next to proceed to setting the priority.

  8. Set the rule priority.

  9. Click Create to save the rule.

Modify a rule#

You can modify conditions, actions, and transformations, but not the rule priority.

  1. Go to the section Load balancing Load balancers.

  2. Click the load balancer name to go to its page and open the Listeners tab.

  3. Click on the Protocol:Port field of the desired listener to go to its page.

  4. Open the Rules tab and select the rule in the resource table.

  5. Click Change.

  6. You can leave the conditions unchanged and move on directly to the next step to modify the action.

    Note

    To modify the condition of a particular type, delete it first.

    To delete a condition:

    • Select conditions in the Conditions block.

    • Click Remove.

    To add a condition:

    • Select the Condition type and set the conditions in the Condition values field.

    • Click Add to add conditions.

    Click Next to proceed to the next step.

  7. If necessary, modify the action to be triggered when the rule conditions are met (for details, see about the supported actions).

    • For the Forward action, click Next to proceed to transformations.

    • For the Fixed response action, click Save.

    • For the Redirect action, click Save.

  8. (Optional) Modify the transformations. This step is available only for the Forward action. To delete a transformation, select it in the Transformations section and click Remove. To add a transformation, select the Transformation type, specify the Regular expression and Replacement, and click Add. Click Save to modify the rule.

Delete a rule#

  1. Go to the section Load balancing Load balancers.

  2. Click the load balancer name to go to its page and open the Listeners tab.

  3. Click on the Protocol:Port field of the desired listener to go to its page.

  4. Open the Rules tab, select a rule in the resource table, and click Delete. You can select multiple rules at once.

  5. In the window that opens, click Delete.

Alarm setup#

You can use alarms to configure the execution of a specified action when the ALB parameters goes beyond the specified thresholds.

Important

Alarm configuration for application load balancers is not yet available in the new web interface. Use the previous version of the web interface.

Load balancer information#

The resource page displays data about the load balancer, its related listeners, and network interfaces. To open a specific load balancer page, go to the section Load balancing Load balancer and click its name in the resource table.

The Information tab shows general information about the load balancer:

  • balancer name;

  • DNS name;

  • creation date;

  • state;

  • balancer type;

  • scheme in use;

  • VPC where the balancer was created;

  • ARN of the balancer;

  • availability zones where there are network interfaces of the balancer;

  • the number of listeners;

  • the number of network interfaces.

In addition, here you can associate subnets with a balancer and delete it.

The Listeners tab displays a table with details of the listeners in use:

  • listener name (Name tag);

  • ARN of the listener;

  • action to be taken with the link to the target group;

  • port to which traffic comes, and protocol in use.

The sequence and scope of the displayed data may vary depending on the table settings.

In addition, here you can add a listener, modify its settings, set tags, and delete it.

The Network Interfaces tab displays a table with details of the network interfaces used by the load balancer:

  • network interface ID;

  • Name tag;

  • brief description;

  • state;

  • subnet;

  • availability zone;

  • VPC;

  • IP address.

Depending on the balancer scheme selected, either its private IP address or the assigned Elastic IP address is displayed.

In the Metrics tab, you can view the graphs of the monitored metrics. You can set the period the metric graph covers, statistics, and metric calculation interval. To automatically refresh the graph, enable Auto-refresh; to refresh it manually, click Refresh.

Important

Automatic refresh is not possible when a custom period and/or interval is selected.

The Alarms tab displays details of alarms configured for the resource:

  • state;

  • alarm name;

  • triggering condition.

Alarms can be filtered by a state and/or metrics.

Here you can also create, modify or delete an alarm.

The Tags tab displays information about the assigned tags. Here you can also assign tags to a load balancer.