--- title: "put-bucket-lifecycle-configuration" slug: "put-bucket-lifecycle-configuration" updated: 2026-10-08T04:58:37Z published: 2026-10-08T04:58:37Z canonical: "cli.ncloud-docs.com/put-bucket-lifecycle-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-bucket-lifecycle-configuration Available in Classic and VPC Register a new lifecycle rule on an Ncloud Storage bucket or overwrite an existing lifecycle rule. Note For a Sub Account user to execute this command, they must have the Change/PutLifecycleConfiguration action permission. ## Syntax The `put-bucket-lifecycle-configuration` syntax is as follows: ``` aws s3api put-bucket-lifecycle-configuration \ --bucket \ --lifecycle-configuration \ --endpoint-url ``` ## Options This section describes the options available when running `put-bucket-lifecycle-configuration`. ### Required options The following options are required for `put-bucket-lifecycle-configuration`. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--bucket` | String | Required | Bucket name | | `--lifecycle-configuration` | String | Required | Lifecycle rule - See [Syntax](/docs/en/put-bucket-lifecycle-configuration#lifecycleconfiguration%EA%B5%AC%EB%AC%B8). | #### `--lifecycle-configuration` syntax - Example 1: When bucket versioning is disabled - According to the `Transition` rule, objects with the `documents/` prefix are transitioned to the `DEEP_ARCHIVE` storage class after 180 days. - According to the `Expiration` rule, objects with the `logs/` prefix are deleted 360 days after creation. ``` { "Rules": [ { "ID": "tran_documents", "Filter": { "Prefix": "documents/" }, "Status": "Enabled", "Transitions": [ { "Days": 180, "StorageClass": "DEEP_ARCHIVE" } ] }, { "ID": "exp_logs", "Filter": { "Prefix": "logs/" }, "Status": "Enabled", "Expiration": { "Days": 360 } } ] } ``` - Examples 2: When bucket versioning is enabled - According to the `NoncurrentVersionTransition` rule, all object versions—except for the five most recent previous versions with the `documents/` prefix—are automatically transitioned to the `DEEP_ARCHIVE` storage class 180 days after they become non-current. - According to the `NoncurrentVersionExpiration` rule, objects with the `logs/` prefix are deleted 100 days after they become non-current. ``` { "Rules": [ { "ID": "tran_noncurrent_documents", "Filter": { "Prefix": "documents/" }, "Status": "Enabled", "NoncurrentVersionTransitions": [ { "NewerNoncurrentVersions": 5, "NoncurrentDays": 180, "StorageClass": "DEEP_ARCHIVE" } ] }, { "ID": "exp_noncurrent_logs", "Filter": { "Prefix": "logs/" }, "Status": "Enabled", "NoncurrentVersionExpiration": { "NoncurrentDays": 100 } } ] } ``` ### 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 request to register a lifecycle rule is successful, the rule is applied, and no result is displayed. ### Command The command example is as follows: ``` aws s3api put-bucket-lifecycle-configuration --bucket my-test-bucket \ --lifecycle-configuration file://lifecycle.json \ --endpoint-url=https://kr.ncloudstorage.com ``` ## Related commands Related commands are as follows: - [delete-bucket-lifecycle](/docs/en/delete-bucket-lifecycle) - [get-bucket-lifecycle-configuration](/docs/en/get-bucket-lifecycle-configuration)