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:
- AWS CLI using a lifecycle JSON configuration.
- API using an XML configuration.
Features of creating lifecycle rules:
-
The configuration must contain at least one rule.
-
The rule name (the
IDparameter) is a unique identifier consisting only of digits, Latin letters, and the_,., and-characters. -
Each lifecycle rule includes:
-
A filter (the
Filterparameter) to select objects covered by the rule. It may contain one or two types of filtering: -
Object lifetime (the
Expirationparameter). 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
AbortIncompleteMultipartUploadparameter. 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.
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.
{"Rules": [{"ID": "Object expiration rule","Status": "Enabled","Expiration": {"Days": 1, // Specified instead of ExpiredObjectDeleteMarker"ExpiredObjectDeleteMarker": true // Specified instead of Days (only for versioned buckets)},"ID": "string","Status": "Enabled","Filter": {"And": {"Prefix": "string","Tags": [{ "Key": "tagKey1", "Value": "tagValue1" },{ "Key": "tagKey2", "Value": "tagValue2" },{ "Key": "tagKey3", "Value": "tagValue3" }]}},"NoncurrentVersionExpiration": { // Only for versioned buckets"NoncurrentDays": 30,"NewerNoncurrentVersions": 50},"AbortIncompleteMultipartUpload": { // Aborting incomplete multipart uploads"DaysAfterInitiation": 7}}]}
Name | Description |
|---|---|
| The object lifetime. Depending on the current version of the object, the versioning status and the presence of a delete marker, one of the actions will be applied to the object after this period expires. For a bucket with versioning disabled, the object is deleted permanently. For a bucket with versioning enabled:
For a bucket with versioning suspended:
Specified using the Format: Full path: |
| The number of days after upload to the bucket. Incompatible with the Format: Full path: |
(only for versioned buckets) | An option that determines whether to remove the object delete marker from the bucket when no other versions of this object remain. Format: Full path: |
| A unique rule identifier. Format: Full path: |
| The rule status. Format: Possible values:
Full path: |
| A filter for the objects to which the rule applies. Format: Full path: |
| A configuration element that is used when both prefix-based and multiple tag-based filtering are applied in a single rule. Format: Full path: |
| The prefix of the object key Format: Full path: |
| The object tags as an array. Each element of the Format: Full path: |
| The tag key. Format: Full path: |
| The tag value. Format: Full path: |
(only for versioned buckets) | Conditions for deleting noncurrent versions of an object. Format: Full path: |
(only for versioned buckets) | The number of days a noncurrent version of an object is stored, after which this version is deleted. If used together with Format: Full path: |
(only for versioned buckets) | The number of stored noncurrent versions of an object. When the specified limit is reached, older versions of the object will be deleted automatically. If used together with Format: Full path: |
| Conditions for aborting incomplete multipart uploads.
The rule applies to all incomplete uploads, including existing ones. Format: Full path: |
| The number of days after multipart upload initiation, after which the incomplete upload is aborted. Format: Full path: |
{"Rules": [{"Expiration": {"Days": 30, // Specified instead of ExpiredObjectDeleteMarker"ExpiredObjectDeleteMarker": true // Specified instead of Days (only for versioned buckets)},"ID": "string","Status": "Enabled","Filter": {"Prefix": "string"},"NoncurrentVersionExpiration": { // Only for versioned buckets"NoncurrentDays": 30,"NewerNoncurrentVersions": 50},"AbortIncompleteMultipartUpload": { // Aborting incomplete multipart uploads"DaysAfterInitiation": 7}}]}
Name | Description |
|---|---|
| The object lifetime. Depending on the current version of the object, the versioning status and the presence of a delete marker, one of the actions will be applied to the object after this period expires. For a bucket with versioning disabled, the object is deleted permanently. For a bucket with versioning enabled:
For a bucket with versioning suspended:
Specified using the Format: Full path: |
| The number of days after upload to the bucket. Incompatible with the Format: Full path: |
(only for versioned buckets) | An option that determines whether to remove the object delete marker from the bucket when no other versions of this object remain. Format: Full path: |
| A unique rule identifier. Format: Full path: |
| The rule status. Format: Possible values:
Full path: |
| A filter for the objects to which the rule applies. Format: Full path: |
| The prefix of the object key Format: Full path: |
(only for versioned buckets) | Conditions for deleting noncurrent versions of an object. Format: Full path: |
(only for versioned buckets) | The number of days a noncurrent version of an object is stored, after which this version is deleted. If used together with Format: Full path: |
(only for versioned buckets) | The number of stored noncurrent versions of an object. When the specified limit is reached, older versions of the object will be deleted automatically. If used together with Format: Full path: |
| Conditions for aborting incomplete multipart uploads.
The rule applies to all incomplete uploads, including existing ones. Format: Full path: |
| The number of days after multipart upload initiation, after which the incomplete upload is aborted. Format: Full path: |
{"Rules": [{"Expiration": {"Days": 30, // Specified instead of ExpiredObjectDeleteMarker"ExpiredObjectDeleteMarker": true // Specified instead of Days (only for versioned buckets)},"ID": "string","Status": "Enabled","Filter": {"Tag": { "Key": "env", "Value": "prod" }},"NoncurrentVersionExpiration": { // Only for versioned buckets"NoncurrentDays": 30,"NewerNoncurrentVersions": 50},"AbortIncompleteMultipartUpload": { // Aborting incomplete multipart uploads"DaysAfterInitiation": 7}}]}
Name | Description |
|---|---|
| The object lifetime. Depending on the current version of the object, the versioning status and the presence of a delete marker, one of the actions will be applied to the object after this period expires. For a bucket with versioning disabled, the object is deleted permanently. For a bucket with versioning enabled:
For a bucket with versioning suspended:
Specified using the Format: Full path: |
| The number of days after upload to the bucket. Incompatible with the Format: Full path: |
(only for versioned buckets) | An option that determines whether to remove the object delete marker from the bucket when no other versions of this object remain. Incompatible with the Format: Full path: |
| A unique rule identifier. Format: Full path: |
| The rule status. Format: Possible values:
Full path: |
| A filter for the objects to which the rule applies. Format: Full path: |
| The object tag as a Format: Full path: |
(only for versioned buckets) | Conditions for deleting noncurrent versions of an object. Format: Full path: |
(only for versioned buckets) | The number of days a noncurrent version of an object is stored, after which this version is deleted. If used together with Format: Full path: |
(only for versioned buckets) | The number of stored noncurrent versions of an object. When the specified limit is reached, older versions of the object will be deleted automatically. If used together with Format: Full path: |
| Conditions for aborting incomplete multipart uploads.
The rule applies to all incomplete uploads, including existing ones. Format: Full path: |
| The number of days after multipart upload initiation, after which the incomplete upload is aborted. Format: Full path: |
- Table of Contents