Deleting a listener
To delete a listener for your network load balancer:
- In the management console
, select the folder where you need to delete a load balancer listener. - In the list of services, select Network Load Balancer.
- Select the network load balancer whose listener you need to delete.
- Under Listeners, click
next to the listener to delete. - In the menu that opens, click Remove listener.
If you do not have the Yandex Cloud (CLI) command line interface 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.
To delete a network load balancer listener, run this command:
yc load-balancer network-load-balancer remove-listener <load_balancer_name_or_ID> \
--listener-name=<listener_name>
You can get the load balancer ID and name with the list of network load balancers in the folder, and the listener name with network load balancer details.
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.
To delete a network load balancer listener created with Terraform:
-
Open the Terraform configuration file and delete the section describing the listener.
resource "yandex_lb_network_load_balancer" "foo" { ... listener { name = "<listener_name>" port = <port_number> external_address_spec { ip_version = "<IP_address_version>" } } ... }
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validate
Terraform will show any errors found in your configuration files.
-
-
Delete the network load balancer.
-
Run this command to view the planned changes:
terraform plan
If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply
-
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
To remove a network load balancer listener, use the removeListener REST API method for the NetworkLoadBalancer resource or the NetworkLoadBalancerService/RemoveListener gRPC API call, providing the following in your request:
- Load balancer ID in the
networkLoadBalancerId
parameter. - Listener name in the
listenerName
parameter.
You can get the load balancer ID with the list of network load balancers in the folder, and the listener name with network load balancer details.