Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Updating an instance group
      • Updating an instance group based on a YAML specification
      • Enable deletion protection
      • Disabling and enabling availability zones for an instance group
      • Moving an instance group to a different availability zone
      • Moving an instance group with a network load balancer to a different availability zone
      • Moving an instance group with an L7 load balancer to a different availability zone
      • Configuring application health checks on a VM instance
      • Pausing an instance group
      • Resuming an instance group
      • Sequentially restarting instances in a group
      • Sequentially recreating instances in a group
      • Stopping an instance group
      • Starting an instance group
      • Configuring instance group access permissions
      • Removing an instance group from a placement group
      • Deleting an instance group
    • Viewing service resource operations
    • Viewing metrics in Monitoring
    • NVIDIA driver update guide
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Managing an instance group
  3. Enable deletion protection

Enabling deletion protection for a Compute Cloud instance group

Written by
Yandex Cloud
Updated at January 13, 2026

Deletion protection prevents accidental deletion of an instance group. You cannot delete a group while the value is true. To delete a group with protection on, you must turn it off first.

Management console
CLI
Terraform
API
  1. In the management console, open the folder containing the instance group in question.
  2. Go to Compute Cloud.
  3. In the left-hand panel, select Instance groups.
  4. Select a group to enable deletion protection for.
  5. In the top-right corner of the page, click Edit.
  6. Enable Deletion protection.
  7. Click Save.

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.

  1. See the description of the CLI command for updating an instance group:

    yc compute instance-group update --help
    
  2. Get a list of instance groups in the default folder:

    yc compute instance-group list
    

    Result:

    +----------------------+----------------------+--------+------+
    |          ID          |          NAME        | STATUS | SIZE |
    +----------------------+----------------------+--------+------+
    | cl15b3mrkk88******** | first-instance-group | ACTIVE |    3 |
    +----------------------+----------------------+--------+------+
    
  3. Select ID of the instance group in question.

  4. In the YAML file that was used to create the group, specify deletion_protection: true. If this YAML file was not saved, get the instance group info and create a new one, e.g., specification.yaml. For more information, see Creating a fixed-size instance group.

  5. Update the instance group in the default folder:

    yc compute instance-group update \
      --id <instance_group_ID> \
      --file specification.yaml
    

    Instance Groups will initiate an instance group update.

    Result:

    done (4m55s)
    id: cl15b3mrkk88********
    folder_id: b1g07hj5r6i4********
    created_at: "2025-12-10T10:51:35.963Z"
    name: vm-grup
    description: This instance group was created using a YAML configuration file.
    instance_template:
      platform_id: standard-v3
      resources_spec:
        memory: "2147483648"
        cores: "2"
      boot_disk_spec:
        mode: READ_WRITE
        disk_spec:
          type_id: network-ssd
          size: "21474836480"
          image_id: fd8fhpd6j1ea********
      network_interface_specs:
        - network_id: enp1djcrd94k********
          primary_v4_address_spec: {}
      scheduling_policy: {}
    scale_policy:
      fixed_scale:
        size: "3"
    deploy_policy:
      max_unavailable: "1"
      strategy: PROACTIVE
    allocation_policy:
      zones:
        - zone_id: ru-central1-b
    load_balancer_state: {}
    managed_instances_state:
      target_size: "3"
    service_account_id: ajeb9l33h6mu********
    status: ACTIVE
    deletion_protection: true
    application_load_balancer_state: {}
    

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

  1. Open the Terraform configuration file and add the deletion_protection property to the instance group description:

    ...
    resource "yandex_compute_instance_group" "ig-1" {
      name                = "fixed-ig"
      folder_id           = "<folder_ID>"
      service_account_id  = "<service_account_ID>"
      deletion_protection = true
      depends_on          = [yandex_resourcemanager_folder_iam_member.compute_editor]
      instance_template {
        platform_id = "standard-v3"
        resources {
          memory = 2
          cores  = 2
        }
        ...
      }
    }
    

    Where deletion_protection is instance group deletion protection: true or false. You cannot delete a group while the value is true. The default value is false.

    For more information about yandex_compute_instance_group properties, see this Terraform article.

  2. Apply the changes:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

  3. Check the instance group update using the management console or this CLI command:

    yc compute instance-group get <instance_group_name>
    

Use the update REST API method for the InstanceGroup resource or the InstanceGroupService/Update gRPC API call.

To request a list of available instance groups, use the listInstances REST API method or the InstanceGroupService/ListInstances gRPC API call.

Disable deletion protectionDisable deletion protection

To disable instance group deletion protection:

Management console
CLI
Terraform
API
  1. In the management console, open the folder containing the instance group in question.
  2. Go to Compute Cloud.
  3. In the left-hand panel, select Instance groups.
  4. Select the group to disable deletion protection for.
  5. In the top-right corner of the page, click Edit.
  6. Disable Deletion protection.
  7. Click Save.

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.

  1. See the description of the CLI command for updating an instance group:

    yc compute instance-group update --help
    
  2. Get a list of instance groups in the default folder:

    yc compute instance-group list
    

    Result:

    +----------------------+----------------------+--------+------+
    |          ID          |          NAME        | STATUS | SIZE |
    +----------------------+----------------------+--------+------+
    | cl15b3mrkk88******** | first-instance-group | ACTIVE |    3 |
    +----------------------+----------------------+--------+------+
    
  3. Select ID of the instance group in question.

  4. In the YAML file that was used to create the group, set deletion_protection: false. If this YAML file was not saved, get the instance group info and create a new one, e.g., specification.yaml. For more information, see Creating a fixed-size instance group.

  5. Disable deletion protection:

     yc compute instance-group update \
       --id <instance_group_ID> \
       --file specification.yaml
    

    Instance Groups will initiate an instance group update.

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

  1. Open the Terraform configuration file and set deletion_protection to false in the instance group description:

    ...
    resource "yandex_compute_instance_group" "ig-1" {
      name                = "fixed-ig"
      folder_id           = "<folder_ID>"
      service_account_id  = "<service_account_ID>"
      deletion_protection = false
      depends_on          = [yandex_resourcemanager_folder_iam_member.compute_editor]
      instance_template {
        platform_id = "standard-v3"
        resources {
          memory = 2
          cores  = 2
        }
        ...
      }
    }
    

    For more information about yandex_compute_instance_group properties, see this Terraform article.

  2. Apply the changes:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

  3. Check the instance group update using the management console or this CLI command:

    yc compute instance-group get <instance_group_name>
    

Use the update REST API method for the InstanceGroup resource or the InstanceGroupService/Update gRPC API call.

To request a list of available instance groups, use the listInstances REST API method or the InstanceGroupService/ListInstances gRPC API call.

See alsoSee also

  • Deleting an instance group

Was the article helpful?

Previous
Updating an instance group based on a YAML specification
Next
Disabling and enabling availability zones for an instance group
© 2026 Direct Cursus Technology L.L.C.