Delete an instance group
Warning
You cannot cancel an instance group's deletion or restore it. Along with the group, you delete the Network Load Balancer or Application Load Balancer target group, VMs, 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 you need. - Select Compute Cloud.
- In the left-hand panel, select
Instance groups. - In the line with the appropriate instance group, click
and select Delete. - In the window that opens, click Delete.
If you do not 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 instance group delete command below:
yc compute instance-group delete --help
-
Get a list of instance groups in the default folder:
yc compute instance-group list
Result:
+----------------------+-----------------------+------+ | ID | NAME | SIZE | +----------------------+-----------------------+------+ | amc65sbgfqeq******** | first-instance-group | 2 | +----------------------+-----------------------+------+
-
Select the group
ID
orNAME
, e.g.,first-instance-group
. -
Delete the instance group:
yc compute instance-group delete --name first-instance-group
Instance Groups will launch the instance deletion process.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
If you created an instance group using Terraform, you can delete it:
-
In the command line, go to the directory with the Terraform configuration file.
-
Delete the resources using this command:
terraform destroy
Alert
Terraform deletes all the resources that you created in the current configuration, such as clusters, networks, subnets, and instances.
-
Type
yes
and press Enter.
Use the delete REST API method for the InstanceGroup resource or the InstanceGroupService/Delete gRPC API call.
To request the list of available instance groups, use the listInstances REST API method or the InstanceGroupService/ListInstances gRPC API call.