Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Backup
    • All guides
    • Activating the service
      • Creating a policy
      • Updating a policy
      • Linking a resource to a policy
      • Getting information about a policy
      • Unlinking a resource from a policy
      • Deleting a policy
    • Restoring the Cloud Backup agent
    • Viewing operations on service resources
    • Limiting RAM usage by the Cloud Backup agent
    • Viewing backup statistics
    • Setting up Monium alerts
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • Troubleshooting
  1. Step-by-step guides
  2. Backup policies
  3. Linking a resource to a policy

Linking a resource to a backup policy

Written by
Yandex Cloud
Updated at August 5, 2026
View in Markdown

You can only link resources to a backup policy if they are connected to Yandex Cloud Backup. For more information, see Managing Yandex Compute Cloud VMs in Cloud Backup, Managing BareMetal servers in Cloud Backup, and Managing external VMs and servers in Cloud Backup.

Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to link a resource to a backup policy.

  2. Navigate to Cloud Backup.

  3. Navigate to the Backup policies tab.

  4. Select the policy you want to link the VM or server to.

  5. Under Attached resources, click Attach a VM, and in the window that opens:

    1. Depending on the resource you want to link to the backup policy, select the Virtual machines or BareMetal servers tab and select the VM or server from the list.

      If the VM or server you want to link to the backup policy is not listed, make sure it is connected to Cloud Backup.

    2. Click Attach.

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

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI command for linking a BareMetal resource to a backup policy:

    yc backup policy apply --help
    
  2. Get the ID of the backup policy you want to link a resource to:

    yc backup policy list
    

    Result:

    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    |          ID          |      FOLDER ID       |  NAME   | ENABLED |     CREATED AT      |     UPDATED AT      |
    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    | abc7n3wln123******** | ghi681qpe789******** | policy1 | true    | 2023-07-03 09:12:02 | 2023-07-03 09:12:43 |
    | deflqbiwc456******** | ghi681qpe789******** | policy2 | true    | 2023-07-07 14:58:23 | 2023-07-07 14:58:23 |
    +----------------------+----------------------+---------+---------+---------------------+---------------------+
    
  3. Get the ID of the resource you want to link:

    yc backup vm list
    

    Result:

    +----------------------+--------------------------------------+--------+---------+--------+-----------------+----------------+---------------------+---------------------+--------+---------------------+---------------------+-------------+
    |     INSTANCE ID      |             RESOURCE ID              | ONLINE | ENABLED | STATUS | STATUS PROGRESS | STATUS DETAILS |  LAST BACKUP TIME   |  NEXT BACKUP TIME   | ACTIVE |     CREATED AT      |     UPDATED AT      |    TYPE     |
    +----------------------+--------------------------------------+--------+---------+--------+-----------------+----------------+---------------------+---------------------+--------+---------------------+---------------------+-------------+
    | ly5mzirn6xhd******** | 4fc0d855-b76c-****-99a4-bf01******** | true   | true    | IDLE   |               0 |                |                     |                     | true   | 2026-04-29 05:45:34 | 2026-04-29 05:54:21 | BMS         |
    | epd930eo5156******** | 6c58577d-409d-****-bc10-f464******** | true   | true    | IDLE   |               0 |                |                     |                     | true   | 2026-04-29 08:46:47 | 2026-04-29 08:54:00 | COMPUTE     |
    | cdgd246kiae3******** | d1fdd342-0ea8-****-9906-fa6c******** | false  | true    | IDLE   |               0 |                | 2026-04-27 13:07:05 | 2026-04-27 13:07:05 | true   | 2026-04-24 14:23:06 | 2026-04-29 08:54:33 | EXTERNAL_VM |
    +----------------------+--------------------------------------+--------+---------+--------+-----------------+----------------+---------------------+---------------------+--------+---------------------+---------------------+-------------+
    
  4. Link the resource to the backup policy by specifying its ID:

    yc backup policy apply <policy_ID> \
      --instance-ids <resource_IDs>
    

    Where --instance-ids are the IDs of the Compute Cloud VMs, BareMetal servers, or external resources connected to Cloud Backup which you need to link to the backup policy. Multiple IDs should be comma-separated.

For more information about this command, see the CLI reference.

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 guides on the Terraform website or its mirror.

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

To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.

To link a resource to a backup policy:

  1. Describe the resource's link settings in the Terraform configuration file:

    resource "yandex_backup_policy_bindings" "test_backup_binding" {
      instance_id = "<resource_ID>"
      policy_id   = "<policy_ID>"
    }
    

    Where:

    • instance_id: ID of the resource you want to link to a backup policy.

      You can get the list of IDs of resources linked to Cloud Backup in the default folder by using the yc backup vm list Yandex Cloud CLI command.

    • policy_id: ID of the backup policy you want to link the resource to.

    For more on the properties of the yandex_backup_policy_bindings resource, see this provider guide.

  2. Create the resources:

    1. In the terminal, navigate to the configuration file directory.

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

      terraform validate
      

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

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

      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.

    4. Apply the configuration 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 backup policy list-applications
    

Use the apply REST API method for the Policy resource or the PolicyService/Apply gRPC API call.

Useful linksUseful links

  • Creating a Linux VM with a connection to Cloud Backup
  • Creating a Windows Server VM with a connection to Cloud Backup
  • Creating a backup policy
  • Detach a backed up resource from a backup policy
  • Connecting resources you need to back up to Cloud Backup
  • Backup policies

Was the article helpful?

Previous
Updating a policy
Next
Getting information about a policy
© 2026 Direct Cursus Technology L.L.C.