Lifecycle Configuration Reference

A lifecycle configuration is a JSON file in which you define the rules you want to apply to the objects of a bucket. With a lifecycle configuration, you can apply an expiration date to the objects stored in a bucket.

This page describes the elements you can specify in a lifecycle configuration file. Once you have written the file, you need to apply it to your bucket. For more information, see Applying a Lifecycle Configuration to Your Bucket.

A delay is to be expected during object deletion.

To create a lifecycle configuration, you need to create a JSON file following this structure:

Configuration structure
{
   "Rules": [
      {
         "ID": "string",
         "Status": "Enabled",
         "Expiration": {
            "Date": "2050-01-01T00:00:00Z",
            "Days": integer,
            "ExpiredObjectDeleteMarker": false
         },
         "NoncurrentVersionExpiration": {
            "NoncurrentDays": integer
         },
         "AbortIncompleteMultipartUpload": {
            "DaysAfterInitiation": integer
         },
         "Filter": {
            "And": {
               "Prefix": "string",
               "Tags": [
                  {
                     "Key": "test",
                     "Value": "test"
                  }
               ]
            }
         }
      }
   ]
}

This file contains the following attributes:

Attribute Required Description

Rules

Yes

One or more rules in the lifecycle configuration.

The order in which you specify the rules is not significant.

ID

No

A unique name for the rule.

The ID can include any character type and must not exceed 255 characters in length.

Status

Yes

If Enabled, the rule is applied. If Disabled, the rule is not applied.

Expiration

No

Specifies the expiration date for the objects.

The deletion of expired objects is asynchronous. This means a delay is to be expected between when the object is marked as expired and when it is effectively removed from the bucket. The actual removal process happens in the background and is managed by OUTSCALE Object Storage (OOS). You are no longer charged for storing objects once they have expired.

Days

No

The lifetime of the objects, in days.

When you create a lifecycle rule, the specified number of days is added to the creation time of your object and then rounded to the nearest midnight UTC. For example, if you create an object on February 1st, 2024 at 06:00 UTC and set a 1-day lifecycle rule, the object will expire on February 3rd, 2024 at exactly midnight UTC.

Date

No

The lifetime of the objects, using a timestamp. The date must be in ISO 8601 (for example 2050-01-01T00:00:00Z). The action is applied once the specified date is reached.

The time is always midnight UTC. Specifying a different time (for example 2050-01-01T16:00:00Z) will not return an error, but the action will still automatically be applied at midnight UTC on the specified date.

You can specify a lifecycle action and set it to a past date. This will immediately qualify all relevant objects for that action.

ExpiredObjectDeleteMarker

No

If true, the expired delete markers of an object is deleted when no older versions of the object are attached to them. This ensures that you do not accumulate unnecessary delete markers in a bucket. For more information, see About Delete Markers.

This rule is not compatible with the Days or Date attributes.

NoncurrentVersionExpiration

No

If true, the noncurrent versions of your objects are automatically deleted once they reach the duration specified in their lifecycle. For more information, see Enabling or Disabling Bucket Versioning.

NoncurrentDays

No

The lifetime, in days, of noncurrent objects.

AbortIncompleteMultipartUpload

No

Specifies when an incomplete multipart upload is aborted. For more information, see Using Multipart Upload.

DaysAfterInitiation

No

The number of days after which an incomplete multipart upload is aborted.

Filter

Yes

Specifies the objects the rule applies to.

The objects are identified with a prefix and/or one or more tags.

  • To have no filtering, use an empty filter:

         "Filter": {}
  • To filter with a prefix, use the following structure:

         "Filter": {
            "Prefix": "string"
         }
  • To filter with one or more tags, use the following structure, with an empty Prefix string:

         "Filter": {
            "And": {
               "Prefix": "",
               "Tags": [
                  {
                     "Key": "test",
                     "Value": "test"
                  }
               ]
            }
         }
  • To filter with a prefix and one or more tags, use the following structure:

         "Filter": {
            "And": {
               "Prefix": "string",
               "Tags": [
                  {
                     "Key": "test",
                     "Value": "test"
                  }
               ]
            }
         }

If a lifecycle rule uses tag filtering, you will not be able to define the ExpiredObjectDeleteMarker and AbortIncompleteMultipartUpload rules.

Related Pages