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
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • 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 Container Registry
  • Getting started
    • All guides
    • Installing and configuring Docker
    • Authentication in Container Registry
      • Getting information about existing repositories
      • Creating a repository
    • Scanning Docker images for vulnerabilities
    • Creating a trigger for a registry
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Troubleshooting
  • FAQ
  1. Step-by-step guides
  2. Managing a repository
  3. Creating a repository

Creating a repository

Written by
Yandex Cloud
Updated at June 9, 2025

Note

A repository will only be displayed after you push a Docker image to it.

To create a repository:

Terraform
API

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or its mirror.

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

  1. Describe the parameters of the yandex_container_repository resource in the configuration file:

    resource "yandex_container_registry" "my-registry" {
      name = "test-registry"
    }
    
    resource "yandex_container_repository" "my-repository" {
      name = "${yandex_container_registry.my-registry.id}/<repository_name>"
    }
    
    output "my-registry-id" {
      value = yandex_container_registry.my-registry.id
    }
    
    output "my-repository-name" {
      value = yandex_container_repository.my-repository.name
    }
    

    Where name is the repository name in <registry_ID>/<repository_name> format. You can retrieve registry ID from the folder registry list.

    For more information about the resources you can create with Terraform, see the provider documentation.

  2. Create resources:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

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

      Success! The configuration is valid.
      
    3. 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 found in your configuration.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    Terraform will create all the required resources. You can check the new resources using the management console or this CLI command:

    yc container repository list --registry-id <registry_ID>
    

To create a repository, use the upsert REST API method for the Repository resource or the RepositoryService/Upsert gRPC API call.

Was the article helpful?

Previous
Getting information about existing repositories
Next
Getting information about existing lifecycle policies
© 2025 Direct Cursus Technology L.L.C.