Object Lock Configuration Reference

An Object Lock configuration is a JSON file in which you define the Object Lock rules you want to apply to a bucket that has the Object Lock feature enabled. With an Object Lock configuration, you can apply a default retention date after which your objects will no longer be protected. This default retention date can be expressed either in days or years.

This page describes the elements you can specify in an Object Lock configuration file. Once you have written the file, you need to apply it to your bucket. For more information, see Configuring a Default Object Lock on Your Bucket.

You can also specify these elements as an inline JSON string.

To create an Object Lock configuration, you need to create a JSON file following this structure:

Configuration structure
  "ObjectLockEnabled": "Enabled",
  "Rule": {
    "DefaultRetention": {
      "Mode": "string",
      "Days": integer

This file contains the following attributes:

Attribute Required Description



Indicates that Object Lock has been enabled on the bucket. The value must always be set to Enabled.



The specific retention rule applied as default for objects placed in the buckets.



Defines the default retention parameters for new objects placed in the bucket.



Specifies the retention mode for the bucket. The value is always COMPLIANCE, which prevents any user, including the root user, from overwriting or deleting objects within the bucket until the retention period expires.

OUTSCALE Object Storage currently does not support GOVERNANCE mode.

Days or Years


The period, in days or years, after which your objects will no longer be protected. The minimum is one day, and the expiration is calculated from the exact time each object is uploaded to the bucket. For example, if the default retention for your bucket is one day and you upload an object at 06:00 UTC, the object will be locked until the next day, at 06:00 UTC.

Keep in mind that in COMPLIANCE mode, it is not possible to bypass the retention period until its expiration. This means you will be billed for the entire retention period you set.

Related Pages