[Yandex Cloud documentation](../../../index.md) > [Yandex Resource Manager](../../index.md) > [Step-by-step guides](../index.md) > Cloud > Deleting a cloud

# Deleting a cloud

To delete a cloud, you must have the [resource-manager.editor](../../security/index.md#resource-manager-editor) role or higher for that cloud. If you cannot perform this operation, contact the [cloud owner](../../concepts/resources-hierarchy.md#owner).

{% note info %}

Deleting a cloud may not be allowed if that cloud or its parent [organization](*organization) is subject to a `resourceManager.denyCloudRemoval` [authorization policy](*access_policies). This restriction still applies even if the user has a [role](*roles) that allows deleting clouds.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), click ![image](../../../_assets/console-icons/layout-side-content-left.svg) or ![image](../../../_assets/console-icons/chevron-down.svg) in the top panel and select the cloud.
  1. To the right of the cloud name, click ![image](../../../_assets/console-icons/ellipsis.svg).
  1. Select ![image](../../../_assets/console-icons/trash-bin.svg) **Delete cloud**.

     ![delete-cloud1](../../../_assets/resource-manager/delete-cloud-1.png)

  1. Select a cloud deletion delay, after which the cloud will be deleted. Select one of the suggested periods or `Delete now`. The default period is seven days.
  1. Enter the cloud name to confirm deletion.
  1. Click **Delete**.

     ![delete-cloud2](../../../_assets/resource-manager/delete-cloud-2.png)

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  1. View a description of the cloud delete command:

      ```bash
      yc resource-manager cloud delete --help
      ```

  1. Get a list of available clouds:

      ```
      yc resource-manager cloud list
      ```
      Result:
      
      ```
      +----------------------+------------+----------------------+--------+
      |          ID          |    NAME    |   ORGANIZATION ID    | LABELS |
      +----------------------+------------+----------------------+--------+
      | b1g66mft1vop******** | my-cloud-1 | bpf2c65rqcl8******** |        |
      | b1gd129pp9ha******** | my-cloud-2 | bpf2c65rqcl8******** |        |
      +----------------------+------------+----------------------+--------+
      ```

  1. Delete the cloud by specifying its name or ID:

      ```bash
      yc resource-manager cloud delete <cloud_name_or_ID> \
        --delete-after <cloud_deletion_delay> \
        --async
      ```

      Where:

      * `--delete-after`: Cloud deletion delay in `HhMmSs` format. Cloud deletion process will start after the specified delay. For example: `--delete-after 22h30m50s`.
      
          Specify `0s` to delete the cloud now.
      * `--async`: Asynchronous deletion flag.
      
          Deleting a cloud can take up to 72 hours. Run the command in asynchronous mode to return to terminal management without waiting for the command to complete.

      Result:

      ```text
      id: b1gqkbbj04d9********
      description: Delete cloud
      created_at: "2024-10-17T05:16:30.648219069Z"
      created_by: ajei280a73vc********
      modified_at: "2024-10-17T05:16:30.648219069Z"
      metadata:
        '@type': type.googleapis.com/yandex.cloud.resourcemanager.v1.DeleteCloudMetadata
        cloud_id: b1g66mft1vop********
        delete_after: "2024-10-18T03:47:19.441433Z"
      ```

      Where `id` is the operation ID you can use to track the operation status later.

  1. (Optional) Get information about the deletion operation status:

      ```bash
      yc operation get <operation_ID>
      ```

      After cloud deletion is complete, the response will contain the `done` field set to `true` (`done: true`).

  For more information about the `yc resource-manager cloud delete` command, see the [CLI reference](../../../cli/cli-ref/resource-manager/cli-ref/cloud/delete.md).

- 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 cloud created using Terraform:

  1. Open the Terraform configuration file and delete the fragment with the cloud description.

      {% cut "Example cloud description in Terraform configuration" %}

      ```hcl
      ...
      resource "yandex_resourcemanager_cloud" "cloud1" {
        name            = "cloud-main"
        organization_id = "bpf7nhb9hkph********"
      }
      ...
      ```

      {% endcut %}

      For more on the properties of the `yandex_resourcemanager_cloud` resource in Terraform, see [this provider guide](../../../terraform/resources/resourcemanager_cloud.md).

  1. In the command line, change to the folder where you edited the configuration file.
  1. Make sure the configuration file is correct using this command:

      ```bash
      terraform validate
      ```

      If the configuration is valid, you will get this message:
     
      ```bash
      Success! The configuration is valid.
      ```

  1. Run this command:

      ```bash
      terraform plan
      ```

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

  1. Apply the configuration changes:

      ```bash
      terraform apply
      ```

  1. Confirm the changes: type `yes` into the terminal and press **Enter**.

      You can check the update using the [management console](https://console.yandex.cloud) or this [CLI](../../../cli/quickstart.md) command:

      ```bash
      yc resource-manager cloud list
      ```

- API {#api}

  To delete the cloud, use the [CloudService/Delete](../../api-ref/grpc/Cloud/delete.md) gRPC API call.

{% endlist %}

Deletion starts from stopping the resources. The cloud enters the `PENDING_DELETION` status. Preparation for deletion starts. The exact time in this status depends on selected deletion delay period. You can [cancel](delete-cancel.md) the deletion of the cloud while it is `PENDING_DELETION`.

{% note alert %}

While the cloud is `PENDING_DELETION`, your disks, reserved IP addresses, and other data remain in storage. The storage cost is calculated at the previous rate. Track how much the resources cost you in [Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts).

{% endnote %}

As soon as the deletion preparation and delay periods are over, the cloud enters the `DELETING` status. This status means it is being permanently deleted, which can take up to 72 hours. All the cloud's resources will be deleted together with it.

[*organization]: [Learn more](../../../organization/concepts/organization.md) about organizations in Yandex Cloud.

[*roles]: [Learn more](../../security/index.md) about the roles available in Yandex Resource Manager.

[*access_policies]: _Access policies_ are a Yandex Identity and Access Management mechanism that allows you to manage permissions for specific operations with [Yandex Cloud](../../../overview/roles-and-resources.md) resources. Access policies complement the [role](../../../iam/concepts/access-control/roles.md) system for more flexible [access management](../../../iam/concepts/access-control/index.md). [Learn more](../../../iam/concepts/access-control/access-policies.md) about access policies in Yandex Cloud.