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 Managed Service for Valkey™
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • Valkey™ version update
      • Working with Valkey™ models
      • Stopping and restarting a cluster
      • Managing cluster hosts
      • Migrating hosts to a different availability zone
      • Managing backups
      • Managing backup policies
      • Managing cluster access
      • Deleting a cluster
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Creating a backup policy
  • Getting a list of backup policies
  • Deleting a backup policy
  1. Step-by-step guides
  2. Clusters
  3. Managing backup policies

Managing backup policies in Yandex Managed Service for Valkey™

Written by
Yandex Cloud
Updated at August 13, 2026
View in Markdown
  • Creating a backup policy
  • Getting a list of backup policies
  • Deleting a backup policy

Backup policies give you flexible control over how cluster backups are created and stored. You can configure a schedule for creating full backups and set their retention period.

Creating a backup policyCreating a backup policy

Management console
CLI
Terraform
REST API
gRPC API
  1. Navigate to Yandex Managed Service for Valkey™.

  2. Click the name of your cluster and select the Backups tab.

  3. On the Backup page, select the Backup policies tab.

  4. Click Create policy.

  5. Specify the parameters of the new policy:

    1. Enter a name and description.

    2. Select one of the backup start options:

      • Every day.
      • By day of the week. For this option, additionally select one or more days of the week.
      • Monthly. For this option, additionally select one or more months and one or more days of the month.

      The backup start time is specified in the cluster settings.

    3. Configure backup storage. You can store backups for 7 to 1,095 days (up to three years).

  6. Click Create.

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 creating a policy:

    yc managed-redis backup-retention-policy create --help
    
  2. Create a policy:

    yc managed-redis backup-retention-policy create \
       --cluster-id <cluster_ID> \
       --policy-name <policy_name> \
       --day-of-month <day_of_month> \
       --month <month> \
       --day-of-week <day_of_week> \
       --retain-for-days <backup_retention_period_in_days> \
       --description <policy_description>
    

    Where:

    • --cluster-id: Cluster ID. You can get it with the list of clusters.
    • --day-of-month: Day of the month. The possible value is 1–31.
    • --month: Month. The possible values are 1–12 or JAN–DEC.
    • --day-of-week: Day of week. The possible values are 0–6 or SUN–SAT.
    • --retain-for-days: Backup retention period in days. The possible value range is 7–1095 (up to three years).

    The --day-of-month, --month, and --day-of-week define the schedule for creating backups. The schedule is defined as a cron expression without hours and minutes.

    Cron expressions also support the following special characters:

    • *: Selecting all possible values. A backup will be created on each scheduled interval (day or month) when possible, provided it does not conflict with other settings. This option is used by default if the setting is not specified.
    • ,: Listing multiple values.
    • –: Specifying a range of values.
    • /: Specifying a step value. For example, */3 for the --day-of-month setting means a backup will be created every three days.

    If no schedule settings are specified, backups are created using the cron expression * * *, meaning they run daily.

    Examples of cron expressions:

    • 1 */6 *: Backup is created on the first day of the month, every six months.
    • 31 jan SUN: Backup is created on Sundays in January, and also on January 31.
    • * * WED: Backup is created every Wednesday.

    You can test your cron expression in this editor.

    Result:

    policy_id: mdbt553glp51********
    cluster_id: c9q5le6h1a4k********
    policy_name: test-policy
    created_at: "2025-03-25T15:55:50.393000450Z"
    cron:
      day_of_month: "25"
      month: mar
      day_of_week: TUE
    retain_for_days: "300"
    
  1. Open the current Terraform configuration file with the infrastructure plan.

    For information on how to create this file, see Creating a cluster.

  2. Add a resource description:

    resource "yandex_mdb_redis_backup_retention_policy" "<policy_name>" {
      cluster_id      = "<cluster_ID>"
      policy_name     = "<policy_name>"
      description     = "<policy_description>"
      retain_for_days = <backup_retention_period_in_days>
    
      cron = {
        day_of_month = "<day_of_month>"
        day_of_week  = "<day_of_week>"
        month        = "<month>"
      }
    }
    

    Where:

    • cluster_id: Cluster ID. You can get it with the list of clusters.
    • retain_for_days: Backup retention period in days. The possible value range is 7–1095 (up to three years).

    • cron: Settings that define the schedule for creating backups.

      • day_of_month: Day of the month. The possible value is 1–31.
      • day_of_week: Day of week. The possible values are 0–6 or SUN–SAT.
      • month: Month. The possible values are 1–12 or JAN–DEC.

      The schedule is defined as a cron expression without hours and minutes.

      Cron expressions also support the following special characters:

      • *: Selecting all possible values. A backup will be created on each scheduled interval (day or month) when possible, provided it does not conflict with other settings. This option is used by default if the setting is not specified.
      • ,: Listing multiple values.
      • –: Specifying a range of values.
      • /: Specifying a step value. For example, */3 for the day_of_month setting means a backup will be created every three days.

      If no schedule settings are specified, backups are created using the cron expression * * *, meaning they run daily.

      Examples of cron expressions:

      • 1 */6 *: Backup is created on the first day of the month, every six months.
      • 31 jan SUN: Backup is created on Sundays in January, and also on January 31.
      • * * WED: Backup is created every Wednesday.

      You can test your cron expression in this editor.

  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    For more information, see this Terraform provider guide.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the BackupRetentionPolicy.Create method, for instance, via the following cURL request:

    curl \
      --request POST \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/retention_policies' \
      --data '{
                 "cron": {
                   "dayOfMonth": "<day_of_month>",
                   "month": "<month>",
                   "dayOfWeek": "<day_of_week>"
                 },
                 "retainForDays": "<retention_period_in_days>",
                 "description": "<policy_description>",
                 "policyName": "<policy_name>"
             }'
    

    Where:

    • <cluster_ID>: Cluster ID which you can get with the list of clusters.
    • dayOfMonth: Day of the month. The possible value is 1-31.
    • month: Month. The possible values are 1-12 or JAN-DEC.
    • dayOfWeek: Day of week. The possible values are 0-6 or SUN-SAT.
    • retainForDays: Backup retention period in days. The possible value range is 7–1095 (up to three years).

    The dayOfMonth, month, and dayOfWeek define the schedule for creating backups. The schedule is defined as a cron expression without hours and minutes.

    Cron expressions also support the following special characters:

    • *: Selecting all possible values. A backup will be created on each scheduled interval (day or month) when possible, provided it does not conflict with other settings. This option is used by default if the setting is not specified.
    • ,: Listing multiple values.
    • –: Specifying a range of values.
    • /: Specifying a step value. For example, */3 for the dayOfMonth setting means a backup will be created every three days.

    If no schedule settings are specified, backups are created using the cron expression * * *, meaning they run daily.

    Examples of cron expressions:

    • 1 */6 *: Backup is created on the first day of the month, every six months.
    • 31 jan SUN: Backup is created on Sundays in January, and also on January 31.
    • * * WED: Backup is created every Wednesday.

    You can test your cron expression in this editor.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. To create a policy:

    1. Call the BackupRetentionPolicyService.Create method, for instance, via the following gRPCurl request:

      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/backup_retention_policy_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d '{
                "cluster_id": "<cluster_ID>",
                "cron": {
                   "day_of_month": "<day_of_month>",
                   "month": "<month>",
                   "day_of_week": "<day_of_week>"
                },
                "retain_for_days": "<backup_retention_period_in_days>",
                "description": "<policy_description>",
                "policy_name": "<policy_name>"
              }' \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.redis.v1.BackupRetentionPolicyService.Create
      

      Where:

      • cluster_id: Cluster ID. You can get it with the list of clusters.
      • day_of_month: Day of the month. The possible value is 1–31.
      • month: Month. The possible values are 1–12 or JAN–DEC.
      • day_of_week: Day of week. The possible values are 0–6 or SUN–SAT.
      • retain_for_days: Backup retention period in days. The possible value range is 7–1095 (up to three years).

      The day_of_month, month, and day_of_week define the schedule for creating backups. The schedule is defined as a cron expression without hours and minutes.

      Cron expressions also support the following special characters:

      • *: Selecting all possible values. A backup will be created on each scheduled interval (day or month) when possible, provided it does not conflict with other settings. This option is used by default if the setting is not specified.
      • ,: Listing multiple values.
      • –: Specifying a range of values.
      • /: Specifying a step value. For example, */3 for the day_of_month setting means a backup will be created every three days.

      If no schedule settings are specified, backups are created using the cron expression * * *, meaning they run daily.

      Examples of cron expressions:

      • 1 */6 *: Backup is created on the first day of the month, every six months.
      • 31 jan SUN: Backup is created on Sundays in January, and also on January 31.
      • * * WED: Backup is created every Wednesday.

      You can test your cron expression in this editor.

    2. Check the server response to make sure your request was successful.

Getting a list of backup policiesGetting a list of backup policies

Management console
CLI
REST API
gRPC API
  1. Navigate to Yandex Managed Service for Valkey™.
  2. Click the name of your cluster and select the Backups tab.
  3. On the Backup page, select the Backup policies tab.

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 getting a list of policies:

    yc managed-redis backup-retention-policy list --help
    
  2. Get a list of policies for the Yandex Managed Service for Valkey™ cluster:

    yc managed-redis backup-retention-policy list \
       --cluster-id <cluster_ID>
    

    You can get the cluster ID from the cluster list.

    Result:

    +----------------------+-------------+--------------------+------------+-------------------+
    |          ID          |     NAME    |     CLUSTER ID     |  CRONTAB   |  RETENTION PERIOD |
    +----------------------+-------------+--------------------+------------+-------------------+
    | mdbt553glp51******** | test-policy | c9q5le6h1a4******* | 31 JAN SUN |                50 |
    +----------------------+-------------+--------------------+------------+-------------------+
    

    Order of parameters in the CRONTAB column: --day-of-month, --month, --day-of-week.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the BackupRetentionPolicy.List method, for instance, via the following cURL request:

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/retention_policies?pageSize=<number_of_results>'
    

    Where:

    • <cluster_ID>: Cluster ID which you can get with the list of clusters.
    • pageSize: Number of query results per page. Specify a number greater than zero.
  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. To get a list of policies for a cluster:

    1. Call the BackupRetentionPolicyService.List method, for instance, via the following gRPCurl request:

      grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/backup_retention_policy_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>",
              "page_size": "<number_of_results>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.BackupRetentionPolicyService.List
      

      Where:

      • cluster_id: Cluster ID. You can get it with the list of clusters.
      • page_size: Number of query results per page. Specify a number greater than zero.
    2. Check the server response to make sure your request was successful.

Deleting a backup policyDeleting a backup policy

Management console
CLI
Terraform
REST API
gRPC API
  1. Navigate to Yandex Managed Service for Valkey™.
  2. Click the name of your cluster and select the Backups tab.
  3. On the Backup page, select the Backup policies tab.
  4. Click in the row of the policy you want to delete.
  5. Select Delete.
  6. In the window that opens, click Delete.

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 deleting a policy:

    yc managed-redis backup-retention-policy delete --help
    
  2. Delete a policy:

    yc managed-redis backup-retention-policy delete <policy_ID> \
       --cluster-id <cluster_ID>
    

    You can get the cluster ID from the list of clusters, and the policy ID from the list of policies.

  1. Open the current Terraform configuration file with the infrastructure plan.

    For information on how to create this file, see Creating a cluster.

  2. Delete the yandex_mdb_redis_backup_retention_policy resource with the name of the policy you want to delete.

  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the BackupRetentionPolicy.Delete method, for instance, via the following cURL request:

    curl \
      --request DELETE \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/retention_policies/<policy_ID>'
    

    You can get the cluster ID from the list of clusters, and the policy ID from the list of policies.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. To delete a policy:

    1. Call the BackupRetentionPolicyService.Delete method, for instance, via the following gRPCurl request:

      grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/backup_retention_policy_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "policy_id": "<policy_ID>",
              "cluster_id": "<cluster_ID>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.BackupRetentionPolicyService.Delete
      

      You can get the cluster ID from the list of clusters, and the policy ID from the list of policies.

    2. Check the server response to make sure your request was successful.

Was the article helpful?

Previous
Managing backups
Next
Managing cluster access
© 2026 Direct Cursus Technology L.L.C.