Skip to main content
You can configure the following lifecycle rules:

How to configure expiration lifecycle rules

When you configure expiration rules, make sure that only the required objects and versions fall under these rules. Otherwise, you can unintentionally delete objects that must be preserved.
In the web console, you can only add lifecycle rules to existing buckets. You cannot create a bucket with a lifecycle rule.To add an expiration lifecycle rule to a bucket:
  1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 Storage → Object Storage.
  2. Open the page of the required bucket.
  3. Go to the Lifecycle rules tab.
  4. Click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1 Add rule.
  5. (Optional) On the page that opens, specify the rule name. It helps identify the rule in a list of lifecycle rules.
  6. Specify which objects the rule applies to:
    • Object key prefix: The rule applies to objects whose names begin with a specified prefix. For instance, if you set the expiring/ prefix, the rule applies to the expiring/test.txt object and does not apply to the test.txt object.
    • Minimum size, bytes: The rule applies to objects larger than the specified size.
    • Maximum size, bytes: The rule applies to objects smaller than the specified size. If you set both a minimum and maximum size, make sure that the maximum size is greater than or equal to the minimum one.
  7. Set the actions that the lifecycle rule should perform:
    • Expiration: Delete objects and versions several days after the object upload or on a certain date. For example, you can delete objects five days after their upload.
    • Non-current version expiration: If you enabled versioning in your bucket, you can delete all versions except for the current one. To make them expire several days after the object upload, specify the required number of days.
    • Abort of incomplete multipart upload: Remove multipart uploads that fail and remain stale. If they take longer than the specified number of days, Object Storage aborts multipart uploads and deletes all the data uploaded.
  8. Click Add rule.

How to configure transition lifecycle rules

Before you configure a transition rule, check your quotas in the project. Make sure that they are sufficient for switching a storage class.
In the web console, you can only add lifecycle rules to existing buckets. You cannot create a bucket with a lifecycle rule.To add a transition lifecycle rule to a bucket:
  1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 Storage → Object Storage.
  2. Open the page of the required bucket.
  3. Go to the Lifecycle rules tab.
  4. Click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1 Add rule.
  5. (Optional) On the page that opens, specify the rule name. It helps identify the rule in a list of lifecycle rules.
  6. Specify which objects the rule applies to:
    • Object key prefix: The rule applies to objects whose names begin with a specified prefix. For instance, if you set the expiring/ prefix, the rule applies to the expiring/test.txt object and does not apply to the test.txt object.
    • Minimum size, bytes: The rule applies to objects larger than the specified size.
    • Maximum size, bytes: The rule applies to objects smaller than the specified size. If you set both a minimum and maximum size, make sure that the maximum size is greater than or equal to the minimum one.
  7. To create a transition lifecycle rule, enable the Modify storage class action.
  8. Select the rule type:
    • Upload: Set the number of days after the object upload. When this period expires, the storage class of the object changes.
    • Last access: Set the number of days after the last access to the object. When this period expires, the storage class changes.
      You can set filters to define what actions are considered the last access to the object. These filters apply to all last-access lifecycle rules.
    • Date: Set a specific date when you need to switch the storage class.
  9. Select a new storage class that the lifecycle rule applies to.
  10. Click Add rule.

(Optional) Filters for last-access lifecycle rules

You can filter actions that Object Storage considers or ignores when it determines the timestamp of the object’s last access. In the filters, specify S3 methods and user agents (such as rclone) that should be included or excluded. Filters apply to all last-access lifecycle rules. You configure them at the bucket level. By default, no filters apply. All and user agents are included.
  1. In the web console, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 Storage → Object Storage.
  2. Open the page of the required bucket.
  3. Go to the Settings tab.
  4. In the Filters for last-access lifecycle rules section, click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/plus.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=7c9efc69d65fc58db0eb73702fd81aa1 Add filter.
  5. In the Filter type field, select one of the following:
    • Include: Consider only the methods and user agents listed in the filter.
    • Exclude: Ignore the methods and user agents listed.
  6. Specify the S3 methods and user agents for the filter. Among the S3 methods, you can set GetObject, HeadObject, GetObjectTagging, CopyObject and UploadPartCopy. If you do not specify methods or user agents, Object Storage considers all of them.
  7. Click Add filter. The new filter appears in the list of filters for last-access lifecycle rules.
  8. Click Save changes to confirm.

Examples of transition lifecycle rules

Below are examples of how to create a bucket with a transition lifecycle rule that triggers if an object was not accessed for a long time.
  • Switch a storage class to Standard if the object has not been accessed in seven days. For the access, do not consider the GetObject and CopyObject methods that were made by using rclone.
    To set such a rule, run the following command:
    nebius storage bucket create --name my-bucket \
       --default-storage-class enhanced_throughput \
       --lifecycle-configuration-rules '[
          {
             "id": "switch-to-standard-in-7-days",
             "status": "ENABLED",
             "transition": {
                "days_since_last_access": 7,
                "storage_class": "STANDARD"
             }
          }
       ]' \
       --lifecycle-configuration-last-access-filter-conditions '[
          {
             "conditions": [
                {
                   "type": "EXCLUDE",
                   "methods": ["GET_OBJECT", "COPY_OBJECT"],
                   "user_agents": ["rclone"]
                }
             ]
          }
       ]'
    
  • Switch a storage class to Standard if the object has not been accessed in three days. For the access, consider only the GetObjectTagging method.
    To set such a rule, run the following command:
    nebius storage bucket create --name my-bucket \
       --default-storage-class enhanced_throughput \
       --lifecycle-configuration-rules '[
          {
             "id": "switch-to-standard-in-3-days",
             "status": "ENABLED",
             "transition": {
                "days_since_last_access": 3,
                "storage_class": "STANDARD"
             }
          }
       ]' \
       --lifecycle-configuration-last-access-filter-conditions '[
          {
             "conditions": [
                {
                   "type": "INCLUDE",
                   "methods": ["GET_OBJECT_TAGGING"]
                }
             ]
          }
       ]'