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

# Updating a folder

To update a [folder](../../concepts/resources-hierarchy.md#folder) name or description, use the management console, CLI, API, or Terraform.

{% 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 folder. You can [switch to another cloud](../cloud/switch-cloud.md), if required.
  1. Click ![image](../../../_assets/console-icons/ellipsis.svg) next to the folder and select **Edit**.
  1. Enter a new name and description for the folder.
  1. Click **Save**.

- CLI {#cli}

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

  1. View the description of the update folder command:

      ```bash
      yc resource-manager folder update --help
      ```
  1. 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:
       ```bash
       yc resource-manager folder list
       ```
     
       Result:
     
       ```text
       +----------------------+--------------------+--------+--------+-------------+
       |          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:
     
       ```bash
       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:
     
       ```bash
       yc compute instance get fhmp74bfis2a********
       ```
     
       Result:
     
       ```text
       id: fhmp74bfis2a********
       folder_id: b1gpvjd9ia42********
       ...
       ```
          
  1. Change the folder parameters, e.g., name and description. You can specify the folder to update by its name or ID.

      ```bash
      yc resource-manager folder update default \
        --new-name myfolder \
        --description "this is my default-folder"
      ```

      The command will rename the `default` folder to `myfolder` and update its description. The folder naming requirements are as follows:

      * Length: between 3 and 63 characters.
      * It can only contain lowercase Latin letters, numbers, and hyphens.
      * It must start with a letter and cannot end with a hyphen.

- 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 edit the settings of a folder created with Terraform:

  1. Open the Terraform configuration file and edit the fragment with the folder description.

     {% cut "Example folder description in a Terraform configuration" %}

     ```hcl
     ...
     resource "yandex_resourcemanager_folder" "folder1" {
       cloud_id    = "b1gia12lt1tp********"
       name        = "myfolder"
       description = "this is my default-folder"
     }
     ...
     ```

     {% endcut %}

     For more information about `yandex_resourcemanager_folder` properties in Terraform, see [this provider guide](../../../terraform/resources/resourcemanager_folder.md).

  1. Check the configuration using this command:
     ```
     terraform validate
     ```
     
     If the configuration is correct, you will get this message:
     
     ```
     Success! The configuration is valid.
     ```

  1. Run this command:
     ```
     terraform plan
     ```
  
     You will see a detailed list of resources. No changes will be made at this step. Terraform will show any errors in the configuration.

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

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

     ```
     yc resource-manager folder list-operations <folder_name_or_ID>
     ```

- API {#api}

  To update a folder, use the [update](../../api-ref/Folder/update.md) REST API method for the [Folder](../../api-ref/Folder/index.md) resource or the [FolderService/Update](../../api-ref/grpc/Folder/update.md) gRPC API call.

{% endlist %}