Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Resource Manager
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Cloud
      • Creating a cloud
      • Rename a cloud
      • Deleting a cloud
      • Canceling cloud deletion
      • Setting up access rights
      • Retrieving a cloud ID
      • Switch clouds
      • Changing an organization for a cloud
      • Cloud incident notifications
    • Folders
      • Creating a folder
      • Updating a folder
      • Deleting a folder
      • How to set up access rights
      • Getting the folder ID
      • Folder incident notifications
  • Concepts
    • Hierarchy of Yandex Cloud resources
    • Notifications from Yandex Cloud
    • Quotas and limits
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • CloudService
      • FolderService
      • OperationService
    • REST
      • Overview
      • Cloud
        • Overview
        • create
        • get
        • list
        • listAccessBindings
        • listOperations
        • setAccessBindings
        • update
        • updateAccessBindings
      • Folder
        • Overview
        • create
        • delete
        • get
        • list
        • listAccessBindings
        • listOperations
        • setAccessBindings
        • update
        • updateAccessBindings
  • Questions and answers
  1. Step-by-step instructions
  2. Folders
  3. Creating a folder

Creating a folder

Written by
Yandex Cloud

    A folder is a space where Yandex Cloud resources are created and grouped.

    Management console
    CLI
    API
    Terraform
    1. In the management console, select a cloud and click Create icon Create folder.

    2. Enter the folder name. Naming requirements:

      • The length can be from 3 to 63 characters.
      • It may contain lowercase Latin letters, numbers, and hyphens.
      • The first character must be a letter. The last character can't be a hyphen.
    3. (Optional) Enter a description of the folder.

    4. Select the Create a default network option. A network is created with subnets in each availability zone. A default security group, where all network traffic is allowed inside, will also be created in this network.

    5. Click Create.

    If you don't have the Yandex Cloud command line interface yet, install and initialize it.

    1. See a description of the create folder command:

      yc resource-manager folder create --help
      
    2. Create a new folder:

      • with a name and without a description:

        yc resource-manager folder create \
          --name new-folder
        
        • The length can be from 3 to 63 characters.
        • It may contain lowercase Latin letters, numbers, and hyphens.
        • The first character must be a letter. The last character can't be a hyphen.
      • with a name and description:

        yc resource-manager folder create \
          --name new-folder \
          --description "my first folder with description"
        

    To create a folder, use the create method for the Folder resource.

    If you don't have Terraform, install it and configure the Yandex Cloud provider.

    1. In the configuration file, describe the parameters of resources that you want to create:

      • cloud_id: ID of the cloud where the folder will be created. Optional. By default, the value specified in the provider settings is used.

      • name: Name of the folder to be created. Required parameter. Naming requirements:

        • The length can be from 3 to 63 characters.
        • It may contain lowercase Latin letters, numbers, and hyphens.
        • The first character must be a letter. The last character can't be a hyphen.
      • description: Folder description. Optional.

      Example configuration file structure:

      resource "yandex_resourcemanager_folder" "folder1" {
        cloud_id    = "<cloud ID>"
        name        = "<name of folder to be created>"
        description = "<folder description>"
      }
      

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

    2. Make sure that the configuration files are correct.

      1. In the command line, go to the directory where you created the configuration file.

      2. Check the configuration using the command:

        terraform validate
        

        If the configuration is correct, the following message is returned:

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

        terraform plan
        

        If the configuration is described correctly, the terminal displays a list of created resources and their parameters. If there are errors in the configuration, Terraform points them out.

    3. Deploy the cloud resources.

      1. If the configuration doesn't contain any errors, run the command:

        terraform apply
        
      2. Confirm the resource creation: type yes in the terminal and press Enter.

      The folder will be created in the specified cloud. You can use the management console or a CLI command to verify that the folder is there:

      yc resource-manager cloud list
      

    Was the article helpful?

    Language / Region
    Yandex project
    © 2023 Yandex.Cloud LLC