Delete an L7 load balancer
To delete an L7 load balancer:
-
In the management console, select the folder where the load balancer was created.
-
Select Application Load Balancer.
-
Click next to the load balancer name and select Delete.
To do this with multiple load balancers, select the load balancers to delete from the list and click Delete at the bottom of the screen.
-
Confirm the deletion.
If you don't have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View a description of the CLI command for removing a load balancer:
yc alb load-balancer delete --help
-
Run the command:
yc alb load-balancer delete <ID or name of the load balancer>
Result:
done (1m10s)
For more information about Terraform, see the documentation.
To delete an L7 load balancer created with Terraform:
-
Open the Terraform configuration file and delete the fragment with the L7 load balancer description.
Sample L7 load balancer description in the Terraform configuration... resource "yandex_alb_load_balancer" "test-balancer" { name = "my-load-balancer" 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 = "my-listener" endpoint { address { external_ipv4_address { } } ports = [ 9000 ] } http { handler { http_router_id = yandex_alb_http_router.test-router.id } } } } ...
-
In the command line, go to the directory with the Terraform configuration file.
-
Check the configuration 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 there are errors in the configuration, Terraform points them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
into the terminal and press Enter.You can verify the changes using the management console or the CLI command below:
yc alb load-balancer list