Editing a backend group
Update group basic settings
Note
To change the group type, you need to use different tools, such as the CLI, Terraform, API.
- In the management console
, select the folder with your backend group. - Select Application Load Balancer.
- In the left-hand panel, select
Backend groups. - Click your group name.
- Click
Edit. - Edit group settings:
-
Backend group Name and Description.
-
Session affinity: If you select this option, the same endpoint will process all requests within one user session.
Note
Currently, session affinity only works for a single active backend in a group, containing at least one target group and using the
MAGLEV_HASH
load balancing mode.HTTP
andgRPC
backend groups support the following session affinity modes:By IP address
.By HTTP header
.By cookie
.
Stream
backend groups only support session affinity by IP address.For more information about session affinity and its modes, see this section.
-
- Click Save at the bottom of the page.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for updating backend group basic settings:
yc alb backend-group update --help
-
Run this command:
yc alb backend-group update \ --name <backend_group_name> \ --new-name <new_backend_group_name> \ --description <backend_group_description> \ --labels key=value[,<key>=<label_value>] \ --connection-affinity source-ip=<IP_address_session_affinity_mode>
Where:
-
--name
: Backend group name. -
--new-name
: Backend group new name. The naming requirements are as follows:- The name must be from 3 to 63 characters long.
- It may contain uppercase and lowercase Latin and Cyrillic letters, numbers, hyphens, underscores, and spaces.
- The first character must be a letter. The last character cannot be a hyphen, underscore, or space.
-
--description
: Backend group description. This is an optional setting. -
--labels key=value
: Labels inkey=value
format. This is an optional setting. -
--connection-affinity
: Session affinity by thesource-ip
IP address. It can be eithertrue
orfalse
. This is an optional setting. You can also use--cookie-affinity
: cookie or--header-affinity
: HTTP header session affinity modes, but you can only specify one mode. For Stream backend groups, you can only use--connection-affinity
mode.Note
Currently, session affinity only works for a single active backend in a group, containing at least one target group and using the
MAGLEV_HASH
load balancing mode.
Result:
id: ds7mi7mlqgct******** name: <backend_group_name> description: update folder_id: b1g6hif00bod******** labels: bar: buz foo: buz http: backends: - name: <backend_name> backend_weight: "2" load_balancing_config: panic_threshold: "90" port: "80" target_groups: target_group_ids: - ds75pc3146dh******** healthchecks: - timeout: 10s interval: 2s healthy_threshold: "10" unhealthy_threshold: "15" healthcheck_port: "80" http: host: <host_address> path: <path> connection: source_ip: true created_at: "2022-11-30T17:46:05.599491104Z"
-
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
-
Open the Terraform configuration file and edit the fragment describing the backend group:
resource "yandex_alb_backend_group" "test-backend-group" { name = "<backend_group_name>" description = "<backend_group_description>" labels = { new-label = "test-label" } session_affinity { connection { source_ip = <IP_address_session_affinity_mode> } } ... }
Where
yandex_alb_backend_group
includes backend group settings:-
name
: Backend group name. -
description
: Backend group description. This is an optional setting. -
labels
: Labels inkey=value
format. This is an optional setting. -
session_affinity
: Optional session affinity settings.Note
Currently, session affinity only works for a single active backend in a group, containing at least one target group and using the
MAGLEV_HASH
load balancing mode.connection
: Session affinity by thesource_ip
IP address. It can be eithertrue
orfalse
. You can also usecookie
orheader
session affinity modes, but you can only specify one mode. ForStream
backend groups consisting ofstream_backend
resources, you can only use theconnection
affinity mode.
For more information about
yandex_alb_backend_group
properties, see the relevant Terraform article . -
-
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
You can check backend group updates in the management console
or using this CLI command:yc alb backend-group get --name <backend_group_name>
-
To change backend group basic settings, use the update REST API method for the BackendGroup resource or the BackendGroupService/Update gRPC API call.
Add a backend to a group
-
In the management console
, select the folder with your backend. -
Select Application Load Balancer.
-
In the left-hand panel, select
Backend groups. -
Click your group name.
-
Click
Create backend. -
In the window that opens, specify backend settings:
-
Backend Name.
-
Weight: Backend weight in traffic distribution. If this option is disabled, the backend weight will be 0 and its endpoints will not be receiving traffic.
-
Backend Type:
Target group
for Application Load Balancer target groups orBucket
for Object Storage buckets. This option works forHTTP
backend groups only.gRPC
and Stream group backends have theTarget group
backend type. For more information about backend types, see Backend types. -
The settings described below only work for Target group backends:
-
Under Load balancing settings:
- Balancing mode: Load balancing mode.
- Panic mode threshold: Healthy endpoint threshold triggering panic mode when the load balancer distributes requests across all endpoints, regardless of their health status.
- Locality aware routing: Share of incoming traffic the load balancer node will route to its availability zone backends. The remaining traffic will be evenly distributed across other availability zones. To learn more, see Locality aware routing.
- Strict locality: If this option is enabled, the load balancer will return
503 Service Unavailable
if no application backends are operational in the request’s originating availability zone.
-
Under Protocol settings:
-
For a
HTTP
backend group:-
HTTP/2: With this option enabled, the load balancer will use the HTTP/2 protocol when routing requests to
HTTP
group backends. By default, the load balancer uses the HTTP/1.1 protocol.gRPC
backend groups only support the HTTP/2 protocol. -
Protocol: Backend connection protocol, e.g.,
HTTP
without encryption orHTTPS
with TLS encryption. ForHTTPS
, specify:
-
-
For a
gRPC
backend group:- Protocol: Backend connection protocol, e.g.,
Plain-text
orEncrypted
. For the encrypted protocol, specify SNI and Trusted root certificate as shown above.
- Protocol: Backend connection protocol, e.g.,
-
For a
Stream
backend group:-
PROXY protocol: With this option enabled, the load balancer will send its client connection metadata, e.g. its IP address, to the backend via HAProxy
protocol. -
Protocol: Backend connection protocol, e.g.,
Plain-text
orEncrypted
. For the encrypted protocol, specify SNI and Trusted root certificate as shown above.
-
-
-
-
The following settings only work for Bucket backends in HTTP backend groups:
- Bucket ID format:
List
orID
. - Bucket: Select a bucket from the list or specify its ID.
- Bucket ID format:
-
Under HTTP health check, gRPC health check, or Stream health check specify:
-
Timeout, s: Response timeout. Maximum connection time.
-
Interval: Health check request interval.
-
Healthy threshold: Number of consecutive successful checks required before considering the endpoint healthy. The load balancer ignores this setting at start, conducting one health check to identify the endpoint as healthy.
-
Unhealthy threshold: Number of consecutive failed checks required before considering the endpoint unhealthy. The load balancer ignores this setting when receiving
503 Service Unavailable
from a backend, following which it is considered unhealthy right away. -
Port.
-
Type: Health check protocol, e.g.,
HTTP
,gRPC
, orStream
. The health check protocol does not need to match the backend group type. Depending on the selected protocol, specify:-
For the
HTTP
type:- Path: Endpoint request URI path.
- Authority: HTTP/1.1
Host
or HTTP/2:authority
header of the backend endpoint health check requests. - HTTP/2: Use HTTP v2 protocol.
- HTTP codes: HTTP status codes deemed valid during a backend health check.
-
For the
gRPC
type:- Service name: Name of the gRPC service you want to check. If no service is specified, the system will check the backend overall health.
-
For the
Stream
type:- Send: Data sent to the endpoint for a health check.
- Receive: Data the endpoint must return to pass the health check.
-
Alert
If all backends with health checks enabled in an availability zone fail those checks, traffic will no longer route to that zone, even if functional backends without health checks remain.
We recommend configuring health checks for all backends.
To add a health check, at the bottom of the backend section, click Add health check and specify the check settings.
To remove a health check, click
next to the HTTP health check, gRPC health check, or Stream health check title, and select Delete. -
-
-
Click Add.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
Add the backend and a health check to the group.
Alert
If all backends with health checks enabled in an availability zone fail those checks, traffic will no longer route to that zone, even if functional backends without health checks remain.
We recommend configuring health checks for all backends.
All backends within a group must be of the same type: HTTP
or Stream
.
HTTP backend
Run this command:
yc alb backend-group add-http-backend \
--backend-group-name <backend_group_name> \
--name <name_of_backend_you_are_adding> \
--weight <backend_weight> \
--port <backend_port> \
--target-group-id=<target_group_ID> \
--panic-threshold 90 \
--http-healthcheck port=80,healthy-threshold=10,unhealthy-threshold=15,expected-statuses=211,\
timeout=10s,interval=2s,host=<host_address>,path=<path>
Where:
--name
: The name of the backend you want to add or update.--panic-threshold
: Panic mode threshold.--http-healthcheck
: Health check settings:port
: Port.healthy-threshold
: Healthy threshold.unhealthy-threshold
: Unhealthy threshold.expected-statuses
: HTTP status code deemed valid during a backend health check. You can add multiple values separated by a comma:expected-statuses=201,expected-statuses=205,expected-statuses=302
. You can use HTTP codes in the range between100
and599
. If this setting is not specified, the response code will be200
.timeout
: Maximum connection time.interval
: Interval.host
: Host address.path
: Path.
Result:
id: a5dqkr2mk3rr********
name: <backend_group_name>
folder_id: aoe197919j8e********
...
host: <host_address>
path: <path>
created_at: "2021-02-11T20:46:21.688940670Z"
gRPC backend
Run this command:
yc alb backend-group add-grpc-backend \
--backend-group-name <backend_group_name> \
--name <name_of_backend_you_are_adding> \
--weight <backend_weight> \
--port <backend_port> \
--target-group-id=<target_group_ID> \
--panic-threshold 90 \
--grpc-healthcheck port=80,healthy-threshold=10,unhealthy-threshold=15,\
timeout=10s,interval=2s,service-name=<gRPC_service_name>
Where:
--panic-threshold
: Panic mode threshold.--grpc-healthcheck
: Resource health check settings:port
: Port.healthy-threshold
: Healthy threshold.unhealthy-threshold
: Unhealthy threshold.timeout
: Maximum connection time.interval
: Interval.service-name
: Name of the gRPC service you want to check. If no service is specified, the system will check the backend overall health.
Result:
id: a5dqkr2mk3rr********
name: <backend_group_name>
folder_id: aoe197919j8e********
...
grpc:
service_name: <gRPC_service_name>
...
created_at: "2021-02-11T20:46:21.688940670Z"
Stream backend
Run this command:
yc alb backend-group add-stream-backend \
--backend-group-name <backend_group_name> \
--name <name_of_backend_you_are_adding> \
--weight <backend_weight> \
--port <backend_port> \
--target-group-id=<target_group_ID> \
--panic-threshold 90 \
--enable-proxy-protocol \
--keep-connections-on-host-health-failure \
--stream-healthcheck port=80,healthy-threshold=10,unhealthy-threshold=15,\
timeout=10s,interval=2s,send-text=<data_to_endpoint>,receive-text=<data_from_endpoint>
Where:
--panic-threshold
: Panic mode threshold.--enable-proxy-protocol
: With this option enabled, the load balancer will send its client connection metadata, e.g. its IP address, to the backend via HAProxy protocol. If you do not set specific values for this option, the load balancer will only send its IP address to the backend.--keep-connections-on-host-health-failure
: Keeps the connection alive even if the health check fails.--stream-healthcheck
: Health check settings:port
: Port.healthy-threshold
: Healthy threshold.unhealthy-threshold
: Unhealthy threshold.timeout
: Maximum connection time.interval
: Interval.send-text
: Data sent to the endpoint for a health check.receive-text
: Data the endpoint must return to pass the health check.
Result:
id: ds77tero4f5********
name: <backend_group_name>
folder_id: b1gu6g9ielh6********
...
text: <data_to_endpoint>
receive:
text: <data_from_endpoint>
enable_proxy_protocol: true
created_at: "2022-04-06T09:17:57.104324513Z"
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
-
Open the Terraform configuration file and add your
http_backend
,grpc_backend
, orstream_backend
description to the backend group section:resource "yandex_alb_backend_group" "test-backend-group" { name = "<backend_group_name>" stream_backend { name = "<backend_name>" weight = 1 port = 80 target_group_ids = ["<target_group_ID>"] load_balancing_config { panic_threshold = 90 } enable_proxy_protocol = true healthcheck { timeout = "10s" interval = "2s" healthy_threshold = 10 unhealthy_threshold = 15 stream_healthcheck { send = "<data_to_endpoint>" receive = "<data_from_endpoint>" } } } }
Where
yandex_alb_backend_group
includes backend group settings:name
: Backend group name.http_backend
,grpc_backend
, orstream_backend
: Backend type. All backends within a group must match the same type:HTTP
,gRPC
, orStream
.
Backend parameters:
-
name
: Backend name. -
port
: Backend port. -
weight
: Backend weight. -
target_group_ids
: Target group ID. To get a list of available target groups, run theyc alb target-group list
CLI command. -
load_balancing_config
: Balancing parameters:panic_threshold
: Panic mode threshold.
-
enable_proxy_protocol
: With this option enabled, the load balancer will send its client connection metadata, e.g. its IP address, to the backend via HAProxy protocol. If you do not set specific values for this option, the load balancer will only send its IP address to the backend. This option is only available forStream
type backends. -
healthcheck
: Health check settings:timeout
: Maximum connection time.interval
: Interval.healthy_threshold
: Healthy threshold.unhealthy_threshold
: Unhealthy threshold.http_healthcheck
:HTTP
health check settings:path
: Path.host
: Host address.
grpc_healthcheck
:gRPC
health check settings:service_name
: Name of the gRPC service you want to check. If no service is specified, the system will check the backend overall health.
stream_healthcheck
:Stream
health check settings:send
: Data sent to the endpoint for a health check.receive
: Data the endpoint must return to pass the health check.
Alert
If all backends with health checks enabled in an availability zone fail those checks, traffic will no longer route to that zone, even if functional backends without health checks remain.
We recommend configuring health checks for all backends.
For more information about
yandex_alb_backend_group
properties, see the relevant Terraform article . -
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
You can check backend group updates in the management console
or using this CLI command:yc alb backend-group get --name <backend_group_name>
-
To change group basic settings, use the addBackend REST API method for the BackendGroup resource or the BackendGroupService/Update gRPC API call.
Update backend settings in a group
- In the management console
, select the folder with your backend. - Select Application Load Balancer.
- In the left-hand panel, select
Backend groups. - Click your group name.
- Next to the backend name, click
and select Edit. - In the window that opens, specify backend settings. For more information about these settings, see above.
- Click Save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for updating backend settings:
yc alb backend-group update-<backend_type>-backend --help
-
Specify new backend settings depending on its type:
HTTP backend
Run this command:
yc alb backend-group update-http-backend \ --backend-group-name <backend_group_name> \ --name <backend_name> \ --weight <backend_weight> \ --port <backend_port> \ --target-group-id=<target_group_ID> \ --panic-threshold 90 \ --http-healthcheck port=80,healthy-threshold=10,unhealthy-threshold=15,expected-statuses=211,\ timeout=10s,interval=2s,host=your-host.com,path=/ping
Where:
--name
: The name of the backend you want to add or update.--panic-threshold
: Panic mode threshold.--http-healthcheck
: Health check settings:port
: Port.healthy-threshold
: Healthy threshold.unhealthy-threshold
: Unhealthy threshold.expected-statuses
: HTTP status code deemed valid during a backend health check. You can add multiple values separated by a comma:expected-statuses=201,expected-statuses=205,expected-statuses=302
. You can use HTTP codes in the range between100
and599
. If this setting is not specified, the response code will be200
.timeout
: Maximum connection time.interval
: Interval.host
: Host address.path
: Path.
Result:
id: a5dqkr2mk3rr******** name: <backend_group_name> folder_id: aoe197919j8e******** ... host: <host_address> path: <path> created_at: "2021-02-11T20:46:21.688940670Z"
gRPC backend
Run this command:
yc alb backend-group update-grpc-backend \ --backend-group-name <backend_group_name> \ --name <name_of_backend_you_are_adding> \ --weight <backend_weight> \ --port <backend_port> \ --target-group-id=<target_group_ID> \ --panic-threshold 90 \ --grpc-healthcheck port=80,healthy-threshold=10,unhealthy-threshold=15,\ timeout=10s,interval=2s,service-name=<gRPC_service_name>
Where:
--panic-threshold
: Panic mode threshold.--grpc-healthcheck
: Resource health check settings:port
: Port.healthy-threshold
: Healthy threshold.unhealthy-threshold
: Unhealthy threshold.timeout
: Maximum connection time.interval
: Interval.service-name
: Name of the gRPC service you want to check. If no service is specified, the system will check the backend overall health.
Result:
id: a5dqkr2mk3rr******** name: <backend_group_name> folder_id: aoe197919j8e******** ... grpc: service_name: <gRPC_service_name> ... created_at: "2021-02-11T20:46:21.688940670Z"
Stream backend
Run this command:
yc alb backend-group update-stream-backend \ --backend-group-name <backend_group_name> \ --name <name_of_backend_you_are_adding> \ --weight <backend_weight> \ --port <backend_port> \ --target-group-id=<target_group_ID> \ --panic-threshold 90 \ --enable-proxy-protocol \ --keep-connections-on-host-health-failure \ --stream-healthcheck port=80,healthy-threshold=10,unhealthy-threshold=15,\ timeout=10s,interval=2s,send-text=<data_to_endpoint>,receive-text=<data_from_endpoint>
Where:
--panic-threshold
: Panic mode threshold.--enable-proxy-protocol
: With this option enabled, the load balancer will send its client connection metadata, e.g. its IP address, to the backend via HAProxy protocol. If you do not set specific values for this option, the load balancer will only send its IP address to the backend.--keep-connections-on-host-health-failure
: Keeps the connection alive even if the health check fails.--stream-healthcheck
: Health check settings:port
: Port.healthy-threshold
: Healthy threshold.unhealthy-threshold
: Unhealthy threshold.timeout
: Maximum connection time.interval
: Interval.send-text
: Data sent to the endpoint for a health check.receive-text
: Data the endpoint must return to pass the health check.
Result:
id: ds77tero4f5******** name: <backend_group_name> folder_id: b1gu6g9ielh6******** ... text: <data_to_endpoint> receive: text: <data_from_endpoint> enable_proxy_protocol: true created_at: "2022-04-06T09:17:57.104324513Z"
Alert
If all backends with health checks enabled in an availability zone fail those checks, traffic will no longer route to that zone, even if functional backends without health checks remain.
We recommend configuring health checks for all backends.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
-
Open the Terraform configuration file and edit your
http_backend
,grpc_backend
, orstream_backend
description in the backend group section:resource "yandex_alb_backend_group" "test-backend-group" { name = "<backend_group_name>" stream_backend { name = "<backend_name>" weight = 1 port = 80 target_group_ids = ["<target_group_ID>"] load_balancing_config { panic_threshold = 90 } enable_proxy_protocol = true healthcheck { timeout = "10s" interval = "2s" healthy_threshold = 10 unhealthy_threshold = 15 stream_healthcheck { send = "<data_to_endpoint>" receive = "<data_from_endpoint>" } } } }
Where
yandex_alb_backend_group
includes backend group settings:name
: Backend group name.http_backend
,grpc_backend
, orstream_backend
: Backend type. All backends within a group must match the same type:HTTP
,gRPC
, orStream
.
Backend parameters:
-
name
: Backend name. -
port
: Backend port. -
weight
: Backend weight. -
target_group_ids
: Target group ID. To get a list of available target groups, run theyc alb target-group list
CLI command. -
load_balancing_config
: Balancing parameters:panic_threshold
: Panic mode threshold.
-
enable_proxy_protocol
: With this option enabled, the load balancer will send its client connection metadata, e.g. its IP address, to the backend via HAProxy protocol. If you do not set specific values for this option, the load balancer will only send its IP address to the backend. This option is only available forStream
type backends. -
healthcheck
: Health check settings:timeout
: Maximum connection time.interval
: Interval.healthy_threshold
: Healthy threshold.unhealthy_threshold
: Unhealthy threshold.http_healthcheck
:HTTP
health check settings:path
: Path.host
: Host address.
grpc_healthcheck
:gRPC
health check settings:service_name
: Name of the gRPC service you want to check. If no service is specified, the system will check the backend overall health.
stream_healthcheck
:Stream
health check settings:send
: Data sent to the endpoint for a health check.receive
: Data the endpoint must return to pass the health check.
Alert
If all backends with health checks enabled in an availability zone fail those checks, traffic will no longer route to that zone, even if functional backends without health checks remain.
We recommend configuring health checks for all backends.
For more information about
yandex_alb_backend_group
properties, see the relevant Terraform article . -
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
You can check backend group updates in the management console
or using this CLI command:yc alb backend-group get --name <backend_group_name>
-
To update backend settings in a group, use the updateBackend REST API method for the UpdateBackend resource or the BackendGroupService/UpdateBackend gRPC API call.
Remove a backend from a group
To remove a backend from a group:
- In the management console
, select the folder with your backend. - Select Application Load Balancer.
- In the left-hand panel, select
Backend groups. - Click your group name.
- Click
next to the backend name, then select Delete. - In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for removing a backend from a group:
yc application-load-balancer delete-<backend_type>-backend --help
-
To delete a backend, run a command depending on its type:
-
HTTP backend:
yc alb backend-group delete-http-backend \ --backend-group-name=<backend_group_name> \ --name=<name_of_backend_to_delete>
-
gRPC backend:
yc alb backend-group delete-grpc-backend \ --backend-group-name=<backend_group_name> \ --name=<name_of_backend_to_delete>
-
Stream backend:
yc alb backend-group delete-stream-backend \ --backend-group-name=<backend_group_name> \ --name=<name_of_backend_to_delete>
Result:
id: a5dqkr2mk3rr******** name: <backend_name> folder_id: aoe197919j8e******** created_at: "2021-02-11T20:46:21.688940670Z"
-
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
-
Open the Terraform configuration file and remove your
http_backend
,grpc_backend
, orstream_backend
description from the backend group section.Sample backend group description in the Terraform configuration:
resource "yandex_alb_backend_group" "test-backend-group" { name = "<backend_group_name>" http_backend { name = "<backend_name>" weight = 1 port = 80 target_group_ids = ["<target_group_ID>"] load_balancing_config { panic_threshold = 90 } healthcheck { timeout = "10s" interval = "2s" healthy_threshold = 10 unhealthy_threshold = 15 http_healthcheck { path = "/" } } } }
For more information about
yandex_alb_backend_group
properties, see the relevant Terraform article . -
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
You can check backend group updates in the management console
or using this CLI command:yc alb backend-group get --name <backend_group_name>
-
Use the removeBackend REST API method for the BackendGroup resource or the BackendGroupService/RemoveBackend gRPC API call.