Deleting an L7 load balancer
To delete an L7 load balancer:
-
In the management console
, select the folder with your load balancer. -
Select Application Load Balancer.
-
Click
next to the load balancer you want to delete, then select Delete.To delete many load balancers at once, select them in the list and click Delete at the bottom of the screen.
-
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 deleting a load balancer:
yc alb load-balancer delete --help
-
Run this command:
yc alb load-balancer delete <load_balancer_name_or_ID>
Result:
done (1m10s)
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
To delete an L7 load balancer created with Terraform:
-
Open the Terraform configuration file and delete the part describing the L7 load balancer.
Sample L7 load balancer description in the Terraform configuration
... resource "yandex_alb_load_balancer" "test-balancer" { name = "<load_balancer_name>" network_id = yandex_vpc_network.test-network.id allocation_policy { location { zone_id = "ru-central1-a" subnet_id = yandex_vpc_subnet.test-subnet.id } } listener { name = "<listener_name>" endpoint { address { external_ipv4_address { } } ports = [ 9000 ] } http { handler { http_router_id = yandex_alb_http_router.test-router.id } } } } ...
-
In the command line, navigate to the directory with the Terraform configuration file.
-
Check the configuration using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
You will see a detailed list of resources. No changes will be made at this step. If your configuration contains errors, Terraform will show them.
-
Apply the changes:
terraform apply
-
Type
yes
and press Enter to confirm changes.You can check updates in the management console
or using this CLI command:yc alb load-balancer list
Use the delete REST API method for the LoadBalancer resource or the LoadBalancerService/Delete gRPC API call.