--- title: "put-bucket-lifecycle-configuration" slug: "put-bucket-lifecycle-configuration" updated: 2026-09-17T09:16:11Z published: 2026-09-17T09:16:11Z 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 Classic/VPC 환경에서 이용 가능합니다. Ncloud Storage 버킷에 수명주기 신규 규칙을 등록하거나 기존 수명주기 규칙을 덮어씁니다. 참고 Sub Account 사용자가 이 명령어를 실행하려면 Change/PutLifecycleConfiguration 액션 권한이 있어야 합니다. ## 구문 `put-bucket-lifecycle-configuration` 구문은 다음과 같습니다. ``` aws s3api put-bucket-lifecycle-configuration \ --bucket \ --lifecycle-configuration \ --endpoint-url ``` ## 옵션 `put-bucket-lifecycle-configuration` 실행 시 지정할 수 있는 옵션을 설명합니다. ### 필수 옵션 `put-bucket-lifecycle-configuration`의 필수 옵션입니다. | 옵션 | 타입 | 필수 여부 | 설명 | | --- | --- | --- | --- | | `--bucket` | String | Required | 버킷 이름 | | `--lifecycle-configuration` | String | Required | 수명주기 규칙 - [구문](/docs/put-bucket-lifecycle-configuration#lifecycleconfiguration%EA%B5%AC%EB%AC%B8) 참조 | #### `--lifecycle-configuration` 구문 - 예시 1: 버킷 버전이 켜져 있지 않을 때 - `Transition` 규칙에 따라 `documents/` 접두사를 가지는 객체들을 180일 이후 `DEEP_ARCHIVE` 스토리지 클래스로 전환합니다. - `Expiration` 규칙에 따라 `logs/` 접두사를 가지는 객체들을 생성 360일 이후 삭제합니다. ``` { "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 } } ] } ``` - 예시 2: 버킷 버전이 켜져 있을 때 - `NoncurrentVersionTransition` 규칙에 따라 `documents/` 접두사를 가지는 가장 최근 5개의 이전 버전을 제외한 나머지 객체 버전을 이전 상태가 된 후 180일이 지나면 자동으로 `DEEP_ARCHIVE` 스토리지 클래스로 전환합니다. - `NoncurrentVersionExpiration` 규칙에 따라 `logs/` 접두사를 가지는 객체가 비최신이 된지 100일이 지나면 삭제합니다. ``` { "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 } } ] } ``` ### 공통 옵션 `aws` 명령에서 공통으로 사용하는 옵션에 대한 정보는 [Ncloud Storage 옵션](/docs/storage-ncloudstorage#%EC%98%B5%EC%85%98)을 참조해 주십시오. ## 예시 수명주기 규칙 등록 요청이 성공하면 규칙이 적용되며 결과는 출력되지 않습니다. ### 명령 명령 예시는 다음과 같습니다. ``` aws s3api put-bucket-lifecycle-configuration --bucket my-test-bucket \ --lifecycle-configuration file://lifecycle.json \ --endpoint-url=https://kr.ncloudstorage.com ``` ## 연관 명령어 연관 명령어는 다음과 같습니다. - [delete-bucket-lifecycle](/docs/delete-bucket-lifecycle) - [get-bucket-lifecycle-configuration](/docs/get-bucket-lifecycle-configuration)