Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Resource Manager
  • Getting started
    • All guides
    • Managing labels
      • Creating a folder
      • Updating a folder
      • Deleting a folder
      • Setting up access rights
      • Getting the folder ID
      • Getting notifications from services in a folder
    • Viewing service resource operations
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Folder
  3. Deleting a folder

Deleting a folder

Written by
Yandex Cloud
Updated at April 22, 2025

To delete a folder, you must have the resource-manager.editor role or higher for that folder. If you cannot perform this operation, contact an administrator or the folder owner.

Management console
CLI
Terraform
API
  1. On the management console home page, select the folder. This page displays folders for the selected cloud. You can switch to another cloud, if required.
  2. Click next to the folder and select Delete.
  3. Select a folder deletion delay: a time period after which the folder will be deleted. Select one of the suggested periods or Delete now. The default folder deletion delay is 7 days.
  4. Click Delete.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

  1. View a description of the folder delete command:

    yc resource-manager folder delete --help
    
  2. If you know the folder ID or name, proceed to the next step. Otherwise, use one of these methods to get them:

    • Get a list of folders:

      yc resource-manager folder list
      

      Result:

      +----------------------+--------------------+--------+--------+-------------+
      |          ID          |        NAME        | LABELS | STATUS | DESCRIPTION |
      +----------------------+--------------------+--------+--------+-------------+
      | b1gppulhhm2a******** | yet-another-folder |        | ACTIVE |             |
      | b1gvmob95yys******** | default            |        | ACTIVE |             |
      +----------------------+--------------------+--------+--------+-------------+
      
      • If you know the ID of the resource that belongs to the required folder, you can get the folder ID from the information about that resource:
      yc <service_name> <service_category> get <resource_ID>
      

      Where:

      • <service_name>: Service name, e.g., compute.
      • <service_category>: Resource category, e.g., instance.
      • <resource_ID>: Resource ID.

      For example, the fhmp74bfis2a******** VM belongs to the b1gpvjd9ir42******** folder:

      yc compute instance get fhmp74bfis2a********
      

      Result:

      id: fhmp74bfis2a********
      folder_id: b1gpvjd9ia42********
      ...
      
  3. Delete the folder by specifying its name or ID:

    yc resource-manager folder delete <folder_name_or_ID> \
      --delete-after <folder_deletion_delay> \
      --async
    

    Where:

    • --delete-after: Folder deletion delay in HhMmSs format. Folder deletion process will start after the specified delay. For example, --delete-after 22h30m50s.

      Specify 0s to delete the folder now.

    • --async: Asynchronous deletion flag.

      Deleting a folder 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:

    id: b1gqkbbj04d9********
    description: Delete folder
    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.DeleteFolderMetadata
      folder_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.

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

    yc operation get <operation_ID>
    

    Once the folder deletion is over, the output will contain the done field set to true (done: true).

For more information about the yc resource-manager folder delete command, see the CLI reference.

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

To delete a folder created with Terraform:

  1. Open the Terraform configuration file and delete the fragment describing the folder.

    Example folder description in a Terraform configuration
    ...
    resource "yandex_resourcemanager_folder" "folder1" {
      cloud_id    = "b1gia12lt1tp********"
      name        = "new-folder"
      description = "this is my default-folder"
    }
    ...
    

    For more information about the yandex_resourcemanager_folder resource parameters in Terraform, see the relevant provider documentation.

  2. In the command line, go to the folder with the Terraform configuration file.

  3. Check the configuration using this command:

    terraform validate
    

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

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

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes into the terminal and press Enter.

    You can check the folder deletion using the management console or this CLI command:

    yc resource-manager folder list
    

To delete a folder, use the delete REST API method for the Folder resource or the FolderService/Delete gRPC API call.

The resources will be stopped, and the folder status will change to PENDING_DELETION. You can cancel the deletion of a folder that is PENDING_DELETION. To do this, click the icon to the right of the folder name in the management console and select Cancel deletion.

Alert

While a folder is PENDING_DELETION, your disks, reserved IPs, and other data are still stored and billed.

While a folder is DELETION, you are still charged for paid resources if metrics detect their consumption.

The cost of such storage is charged at the previous rate. Track your resource costs in Yandex Cloud Billing.

Once the waiting timeout expires, the folder status will change to DELETING. This status means it is being permanently deleted, which can take up to 72 hours. All the folder's resources will be deleted together with it.

Sometimes, the system may cancel the deletion of a folder if it contains resources that cannot be deleted. For more information, see Reasons why a folder cannot be deleted. Once the deletion is canceled, the folder will regain its ACTIVE status, and the user will get a message stating why the folder could not be deleted.

Was the article helpful?

Previous
Updating a folder
Next
Setting up access rights
© 2025 Direct Cursus Technology L.L.C.