Deleting an instance group
Warning
You cannot undo the deletion of an instance group or recover it. Along with the group, you also delete the Network Load Balancer or Application Load Balancer target group, VM instances, and disks. You cannot delete an instance group if it is a target group for a load balancer (Network Load Balancer) or a backend group (Application Load Balancer).
To delete an instance group:
- In the management console
, open the folder containing the instance group in question. - Go to Compute Cloud.
- In the left-hand panel, select
Instance groups. - In the line with the instance group, click
and select Delete. - In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the CLI command for deleting an instance group:
yc compute instance-group delete --help -
Get a list of instance groups in the default folder:
yc compute instance-group listResult:
+----------------------+-----------------------+------+ | ID | NAME | SIZE | +----------------------+-----------------------+------+ | amc65sbgfqeq******** | first-instance-group | 2 | +----------------------+-----------------------+------+ -
Select
IDorNAMEof the group in question, e.g.,first-instance-group. -
Delete the instance group:
yc compute instance-group delete --name first-instance-groupInstance Groups will initiate instance group deletion.
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To delete an instance group created using Terraform, follow these steps:
-
In the command line, go to the folder with the Terraform configuration file.
-
Delete the resources using this command:
terraform destroyAlert
Terraform will delete all the resources you created in the current configuration, such as clusters, networks, subnets, and VMs.
-
Type
yesand press Enter.
Use the delete REST API method for the InstanceGroup resource or the InstanceGroupService/Delete gRPC API call.
To request a list of available instance groups, use the listInstances REST API method or the InstanceGroupService/ListInstances gRPC API call.