Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Object Storage
    • All guides
      • Creating a bucket
      • Deleting a bucket
      • Limiting the maximum size of a bucket
      • Encrypting a bucket
      • Managing object lifecycles
      • Managing CORS configurations
      • Configuring access permissions using IAM
      • Editing a bucket's ACL
      • Managing access policies
      • Configuring public access to a bucket
      • Accessing a bucket using Security Token Service
      • Accessing a bucket using a service connection from VPC
      • Managing bucket versioning
      • Enabling logging
      • Managing object locks
      • Managing bucket labels
      • Getting bucket information and statistics
      • Viewing bucket metrics
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Buckets
  3. Managing bucket versioning

Managing bucket versioning

Written by
Yandex Cloud
Improved by
Tania L.
Updated at December 3, 2025

Bucket versioning enables keeping a history of an object through its versions.

Warning

You cannot disable versioning once you enable it; however, you can pause new version creation. After you pause versioning, new objects will be saved as null versions.

Note

With object version lock on, versioning cannot be paused.

To enable bucket versioning:

Management console
Yandex Cloud CLI
AWS CLI
Terraform
API
  1. In the management console, select a folder.
  2. Go to Object Storage.
  3. Click the name of the bucket in question.
  4. In the left-hand panel, select Settings.
  5. Select the Versioning tab.
  6. To enable or pause versioning, use Store object change history.
  7. Click Save.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for editing a bucket ACL:

    yc storage bucket update --help
    
  2. Run this command:

    yc storage bucket update --name <bucket_name> --versioning versioning-enabled
    

    Result:

    name: my-bucket
    folder_id: csgeoelk7fl15********
    default_storage_class: STANDARD
    versioning: VERSIONING_ENABLED
    max_size: "10737418240"
    acl: {}
    created_at: "2022-12-14T08:42:16.273717Z"
    

If you do not have the AWS CLI yet, install and configure it.

Run this command:

aws --endpoint https://storage.yandexcloud.net \
  s3api put-bucket-versioning \
  --bucket <bucket_name> \
  --versioning-configuration 'Status=Enabled'

Note

Terraform uses a service account to interact with Object Storage. Assign to the service account the required role, e.g., storage.admin, for the folder where you are going to create resources.

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

Retrieve static access keys: a secret key and key ID used for Object Storage authentication.

Note

In addition to static access keys, you can use an IAM token for authentication in Object Storage. For more details, see Creating a bucket and the relevant provider documentation.

In the configuration file, describe the properties of resources you want to create:

resource "yandex_iam_service_account" "sa" {
  name = "<service_account_name>"
}

// Assigning a role to a service account
resource "yandex_resourcemanager_folder_iam_member" "sa-admin" {
  folder_id = "<folder_ID>"
  role      = "storage.admin"
  member    = "serviceAccount:${yandex_iam_service_account.sa.id}"
}

// Creating a static access key
resource "yandex_iam_service_account_static_access_key" "sa-static-key" {
  service_account_id = yandex_iam_service_account.sa.id
  description        = "static access key for object storage"
}

resource "yandex_storage_bucket" "b" {
  bucket     = "<bucket_name>"
  access_key = yandex_iam_service_account_static_access_key.sa-static-key.access_key
  secret_key = yandex_iam_service_account_static_access_key.sa-static-key.secret_key
  acl        = "private"

  versioning {
    enabled = true
  }
}

Where:

  • bucket: Bucket name. This is a required setting.
  • access_key: Static access key ID.
  • secret_key: Secret access key value.
  • acl: ACL policy to apply. The default value is private. This is an optional setting.
  • versioning: Managing bucket versioning:
    • enabled: Enables bucket versioning. This is an optional setting.

To manage bucket versioning, use the update REST API method for the Bucket resource, the BucketService/Update gRPC API call, or the putBucketVersioning S3 API method.

Was the article helpful?

Previous
Accessing a bucket using a service connection from VPC
Next
Enabling logging
© 2025 Direct Cursus Technology L.L.C.