--- title: "put-object-lock-configuration" slug: "put-object-lock-configuration" updated: 2026-10-08T04:59:14Z published: 2026-10-08T04:59:14Z canonical: "cli.ncloud-docs.com/put-object-lock-configuration" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # put-object-lock-configuration Available in Classic and VPC Apply object lock settings on an Ncloud Storage bucket. Using object lock prevents objects from being deleted or modified for a specified period of time. Note For a Sub Account user to execute this command, they must have the Change/PutBucketObjectLockConfiguration action permission. ## Syntax The `put-object-lock-configuration` syntax is as follows: ``` aws s3api put-object-lock-configuration \ --bucket \ --object-lock-configuration \ [--content-md5 ] \ [--checksum-algorithm ] \ --endpoint-url ``` ## Options This section describes the options available when running `put-object-lock-configuration`. ### Required options The following options are required for `put-object-lock-configuration`. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--bucket` | String | Required | Bucket name | | `--object-lock-configuration` | String | Required | Object lock settings - Enter in JSON format. - `ObjectLockEnabled` (required): Whether object lock is enabled. `Enabled` - `Rule.DefaultRetention.Mode` (required): Object retention mode. `GOVERNANCE` (can be bypassed with special permissions) \| `COMPLIANCE` (can't be bypassed by anyone) - `Rule.DefaultRetention.Days` (conditional): Retention period (days). `1`~`36500`. `Rule.DefaultRetention.Days` or `Rule.DefaultRetention.Years` must be entered. - `Rule.DefaultRetention.Years` (conditional): Retention period (years). `1`-`100`. `Rule.DefaultRetention.Years` or `Rule.DefaultRetention.Days` must be entered. | ### Optional options These are the optional options for `put-object-lock-configuration`. Options that are not specified will use their default values. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--content-md5` | String | Optional | Base64-encoded 128-bit MD5 hash of the request data - Used to validate the integrity of the request data - Calculated automatically if not entered | | `--checksum-algorithm` | String | Optional | Checksum algorithm used to validate the request data - `CRC32` \| `CRC32C` \| `SHA1` \| `SHA256` \| `CRC64NVME` | ### Common options For information about the options common to all `aws` subcommands, see [Ncloud Storage options](/docs/en/storage-ncloudstorage#%EC%98%B5%EC%85%98). ## Examples If the object lock configuration request is successful, the settings are applied, and no result is displayed. ### Command The command example is as follows: ``` aws s3api put-object-lock-configuration --bucket my-locked-bucket \ --object-lock-configuration '{"ObjectLockEnabled":"Enabled","Rule":{"DefaultRetention":{"Mode":"GOVERNANCE","Days":1}}}' \ --endpoint-url=https://kr.ncloudstorage.com ``` ## Related commands Related commands are as follows: - [get-object-lock-configuration](/docs/en/get-object-lock-configuration) - [put-object-retention](/docs/en/put-object-retention) - [get-object-retention](/docs/en/get-object-retention) - [put-object-legal-hold](/docs/en/put-object-legal-hold) - [get-object-legal-hold](/docs/en/get-object-legal-hold)