--- title: "put-bucket-lifecycle-configuration" slug: "put-bucket-lifecycle-configuration" updated: 2026-10-22T09:07:27Z published: 2026-10-22T09:07:27Z canonical: "cli-gov.ncloud-docs.com/put-bucket-lifecycle-configuration" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli-gov.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # put-bucket-lifecycle-configuration Classic/VPC 환경에서 이용 가능합니다. Ncloud Storage 버킷에 lifecycle 신규 규칙을 등록하거나 기존 lifecycle 규칙을 덮어씁니다. 참고 2026년 2월 26일 이후부터 만료 기능이 활성화됐습니다. ## 명령어 명령어 구문은 다음과 같습니다. ``` aws s3api put-bucket-lifecycle-configuration --bucket --lifecycle-configuration file://lifecycle.json [--options] ``` ### 파라미터 파라미터에 대한 설명은 다음과 같습니다. | 파라미터 | 타입 | 필수 여부 | 설명 | 제약 사항 | | --- | --- | --- | --- | --- | | --bucket | string | Y | 버킷의 이름 | - | | --lifecycle-configuration | string | Y | lifecycle 규칙 | [Syntax](/docs/put-bucket-lifecycle-configuration#lifecycleSyntax) | | --endpoint-url | string | Y | 명령 호출의 기본 URL 지정 | kr 리전만 가능, 호출 도메인 정보는 [Ncloud Storage 개요](/docs/storage-ncloudstorage#%ED%98%B8%EC%B6%9C%EB%8F%84%EB%A9%94%EC%9D%B8) 참고 | | --cli-input-json \| --cli-input-yaml | string | N | 제공한 json 또는 yaml 문자열에서 인수 입력 | json과 yaml을 함께 지정 불가 | | --generate-cli-skeleton | integer | N | API 명령을 실행하지 않고 이후에 input으로 사용할 수 있는 파라미터 템플릿 생성 | - | | --debug | boolean | N | 디버그 로깅 사용 | - | | --no-verify-ssl | boolean | N | SSL 인증서를 검증하는 기본 동작 재정의 | - | | --no-paginate | boolean | N | 자동 pagination 비활성화, 결과에 대해 첫 번째 페이지 한 번만 호출됨 | - | | --output | string | N | 응답값의 포맷 지정 | 선택한 가능한 옵션 - json - text - table - yaml - yaml-stream | | --query | string | N | 응답 데이터를 필터링하는 데 사용할 JMESPath 쿼리 | - | | --profile | string | N | 자격 증명 파일에서 특정 profile 사용 | - | | --region | string | N | 리전 지정 | kr만 지원 | | --color | string | N | output color 설정 | 선택한 가능한 옵션 - on - off - auto | | --no-sign-request | boolean | N | 자격 증명 로드 비활성화 | - | | --ca-bundle | string | N | SSL 인증서를 확인할 때 사용할 CA 인증서 지정 | - | | --cli-read-timeout | int | N | 최대 읽기 시간, 0으로 입력시 타임아웃이 아닌 차단 상태로 변경됨 | default는 60초로 설정 | | --cli-connect-timeout | int | N | 최대 연결 시간, 0으로 입력시 타임아웃이 아닌 차단 상태로 변경됨 | default는 60초로 설정 | | --no-cli-pager | boolean | N | 응답값의 cli pager 비활성화 | - | | --cli-auto-prompt | boolean | N | CLI 입력 파라미터 자동 프롬프트 설정 | - | | --no-cli-auto-prompt | boolean | N | CLI 입력 파라미터 자동 프롬프트 비활성화 | - | #### --lifecycle-configuration Syntax - Json Syntax 1: 버킷 버전이 켜져 있지 않을 때 아래 예제는 `Transition` 규칙에 따라 "documents/" 접두사를 가지는 object들을 180일 이후 DEEP_ARCHIVE 스토리지 클래스로 전환합니다. `Expiration` 규칙에 따라 "logs/" 접두사를 가지는 object들을 생성 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 } } ] } ``` - Json Syntax 2: 버킷 버전이 켜져 있을 때 아래 예제는 `NoncurrentVersionTransition` 규칙에 따라 "documents/" 접두사를 가지는 가장 최근 5개의 이전 버전을 제외한 나머지 객체 버전을 이전 상태가 된 후 180일이 지나면 자동으로 DEEP_ARCHIVE 스토리지 클래스로 전환합니다. `NoncurrentVersionExpiration` 규칙에 따라 "logs/" 접두사를 가지는 object가 비최신이 된지 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 } } ] } ``` ## 권한 Subaccount 사용자가 이 명령어를 사용하려면 Change/PutLifecycleConfiguration 액션 권한이 필요합니다. ## 예시 put-bucket-lifecycle-configuration 명령어의 호출과 응답 예시를 설명합니다. ### lifecycle 설정 #### 호출 예시 버킷 이름을 지정하여 명령어를 호출하면 lifecycle 규칙이 저장됩니다. ``` aws s3api put-bucket-lifecycle-configuration --endpoint-url=http://kr.gov-ncloudstorage.com --bucket test1 --lifecycle-configuration file://lifecycle.json ``` ## 연관 명령어 연관 명령어는 다음과 같습니다. - [delete-bucket-lifecycle](/docs/delete-bucket-lifecycle) - [get-bucket-lifecycle-configuration](/docs/get-bucket-lifecycle-configuration)