Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Network Load Balancer
  • Getting started
    • All guides
      • Information about existing target groups
      • Creating a target group
      • Attaching a target group to a load balancer
      • Detaching a target group from a load balancer
      • Deleting a target group
    • Viewing operations with resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Target groups
  3. Deleting a target group

Deleting a Network Load Balancer target group

Written by
Yandex Cloud
Updated at May 13, 2025

Alert

Before deleting a target group, detach it from the network load balancer. You cannot restore a target group after it is deleted.

Management console
CLI
Terraform
API

To delete a target group:

  1. In the management console, select the folder where you need to delete a target group.
  2. In the list of services, select Network Load Balancer.
  3. In the left-hand panel, select Target groups.
  4. Click next to the target group you need to delete.
  5. In the menu that opens, select Delete.
  6. In the window that opens, click Delete.

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.

  1. See the description of the CLI command for deleting a target group:

    yc load-balancer target-group delete --help
    
  2. Delete a target group from the default folder:

    yc load-balancer target-group delete <target_group_name_or_ID>
    

    You can get the target group ID and name with the list of target groups in the folder.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To delete a target group created with Terraform:

  1. Open the Terraform configuration file and delete the section describing the target group.

    resource "yandex_lb_target_group" "foo" {
      name      = "<target_group_name>"
      target {
        subnet_id = "<subnet_ID>"
        address   = "<target_internal_IP_address>"
      }
      target {
        subnet_id = "<subnet_ID>"
        address   = "<resource_2_internal_IP_address>"
      }
    }
    
  2. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  3. Delete the network load balancer.

    1. 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

To delete a target group, use the delete REST API method for the TargetGroup resource or the TargetGroupService/Delete gRPC API call.

You can get the target group ID with the list of target groups in the folder.

Was the article helpful?

Previous
Detaching a target group from a load balancer
Next
Viewing operations with resources
© 2025 Direct Cursus Technology L.L.C.