# Deleting a disk snapshot

{% note warning %}

Deleting a [snapshot](../../concepts/snapshot.md) is permanent and cannot be undone, so you cannot recover a deleted snapshot. When you delete a snapshot, all the information it stores is erased. The data on the primary disk will remain unchanged.

{% endnote %}

To delete a snapshot:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the management console, select the folder containing your snapshot.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/picture.svg) **Snapshots**.
  1. In the line with the snapshot, click ![image](../../../_assets/console-icons/ellipsis.svg) and select **Delete**.
  1. In the window that opens, click **Delete**.

- CLI {#cli}

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI commands for deleting snapshots:

     ```bash
     yc compute snapshot delete --help
     ```

  1. Get a list of snapshots in the default folder:

     ```bash
     yc compute snapshot list
     ```
     
     Result:
     
     ```text
     +----------------------+-----------------+----------------------+--------+----------------------------+
     |          ID          |       NAME      |     PRODUCT IDS      | STATUS |        DESCRIPTION         |
     +----------------------+-----------------+----------------------+--------+----------------------------+
     | fd8rlt1u2rf0l******* | first-snapshot  | f2ecl5vhsftd******** | READY  | my first snapshot via CLI  |
     | fhmolt1u2rf0******** | second-snapshot | f2eclmol5lps******** | READY  | my second snapshot via CLI |
     +----------------------+-----------------+----------------------+--------+----------------------------+
     ```

  1. Select `ID` or `NAME` of the snapshot in question.
  1. Delete the snapshot:

     ```bash
     yc compute snapshot delete \
       --name first-snapshot
     ```

- Terraform {#tf}

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../../terraform/authentication.md) using the appropriate method.

  To delete a snapshot created with Terraform, follow these steps:
  1. In the command line, go to the folder with the Terraform configuration file.
  1. Delete the resources using this command:

     ```bash
     terraform destroy
     ```

     {% note alert %}

     Terraform will delete all the resources you created in the current configuration, such as clusters, networks, subnets, and VMs.

     {% endnote %}

  1. Type `yes` and press **Enter**.

- API {#api}

  Use the [delete](../../api-ref/Snapshot/delete.md) REST API method for the [Snapshot](../../api-ref/Snapshot/index.md) resource or the [SnapshotService/Delete](../../api-ref/grpc/Snapshot/delete.md) gRPC API call.

{% endlist %}