VK Cloud logo

Object lifecycle

VK Object Storage allows you to configure the lifecycle of objects in a bucket. Lifecycle is the automated deletion of objects or their versions from a bucket according to specified rules.

Rules are set at the level of a single bucket. It is not possible to configure the lifecycle for a group of buckets or for a project.

In the management console, lifecycle rules can be managed only one at a time. Adding, deleting, and modifying multiple rules at once is possible via:

Features of creating lifecycle rules:

  • The configuration must contain at least one rule.

  • The rule name (the ID parameter) is a unique identifier consisting only of digits, Latin letters, and the _, ., and - characters.

  • Each lifecycle rule includes:

    • A filter (the Filter parameter) to select objects covered by the rule. It may contain one or two types of filtering:

      • By object key prefix (the Prefix parameter). Prefix examples: image, image/, image/photo.

        A single rule can contain only one prefix. To filter objects by multiple prefixes, you need to create a separate rule for each prefix.

      • By object tags (the Tag or Tags parameter).

    • Object lifetime (the Expiration parameter). It defines the number of days after which the object will be deleted.

  • To reduce storage costs, it is recommended to abort incomplete multipart uploads using the AbortIncompleteMultipartUpload parameter. It defines the number of days after the multipart upload initialization, upon expiration of which the incomplete upload will be aborted and the uploaded parts will be deleted.

  • After a rule is added, it is automatically applied to the corresponding objects or object versions in the bucket.

    Afterwards, objects are deleted in the background: first, upon expiration of their lifetime, they become unavailable, and then they are deleted in queue order within the next 24 hours.

Limitations:

  • Each bucket can have no more than 50 rules.
  • When creating rules via the API, the size of the XML file with rules must not exceed 512 KB.

Lifecycle rules operate asynchronously in the background and do not affect the performance of the VK Object Storage service.

Lifecycle rule configuration

  • ID — a unique rule identifier.
  • Status — the rule status. Possible values:

For a JSON configuration, all rules are specified as a Rules array containing elements Rules[i] of the object format.

Was this article helpful?