--- title: "put-object-retention" slug: "put-object-retention" updated: 2026-09-17T09:16:11Z published: 2026-09-17T09:16:11Z canonical: "cli.ncloud-docs.com/put-object-retention" --- > ## 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-retention Classic/VPC 환경에서 이용 가능합니다. Ncloud Storage 객체에 보존 설정을 적용합니다. 보존이 설정된 객체는 지정한 만료일까지 삭제 또는 변경할 수 없습니다. 참고 Sub Account 사용자가 이 명령어를 실행하려면 Change/PutObjectRetention 액션 권한이 있어야 합니다. ## 구문 `put-object-retention` 구문은 다음과 같습니다. ``` aws s3api put-object-retention \ --bucket \ --key \ --retention \ [--version-id ] \ [--bypass-governance-retention | --no-bypass-governance-retention] \ [--content-md5 ] \ [--checksum-algorithm ] \ --endpoint-url ``` ## 옵션 `put-object-retention` 실행 시 지정할 수 있는 옵션을 설명합니다. ### 필수 옵션 `put-object-retention`의 필수 옵션입니다. | 옵션 | 타입 | 필수 여부 | 설명 | | --- | --- | --- | --- | | `--bucket` | String | Required | 버킷 이름 | | `--key` | String | Required | 객체 이름 | | `--retention` | String | Required | 객체 보존 설정 - JSON 형식으로 입력 - `Mode`: `GOVERNANCE` \| `COMPLIANCE` - `RetainUntilDate`: 보존 만료일. ISO 8601 형식, 미래 시점만 지정 가능 - 빈 JSON(`{}`) 입력 시 보존 해제 | ### 선택 옵션 `put-object-retention`의 선택 옵션입니다. 지정하지 않은 옵션에는 기본값이 적용됩니다. | 옵션 | 타입 | 필수 여부 | 설명 | | --- | --- | --- | --- | | `--version-id` | String | Optional | 객체의 버전 ID | | `--bypass-governance-retention` | Boolean | Optional | `GOVERNANCE` 모드 보존 설정 우회 - 우회 권한 필요 | | `--no-bypass-governance-retention` | Boolean | Optional | `GOVERNANCE` 모드 보존 설정 우회 안 함 | | `--content-md5` | String | Optional | 요청 데이터의 Base64 인코딩된 128비트 MD5 해시값 - 요청 데이터의 무결성 검증에 사용 - 미입력 시 자동 계산 | | `--checksum-algorithm` | String | Optional | 요청 데이터 검증에 사용할 체크섬 알고리즘 - `CRC32` \| `CRC32C` \| `SHA1` \| `SHA256` \| `CRC64NVME` | ### 공통 옵션 `aws` 명령에서 공통으로 사용하는 옵션에 대한 정보는 [Ncloud Storage 옵션](/docs/storage-ncloudstorage#%EC%98%B5%EC%85%98)을 참조해 주십시오. ## 예시 보존 설정 요청이 성공하면 설정이 적용되며 결과는 출력되지 않습니다. ### 명령 명령 예시는 다음과 같습니다. ``` aws s3api put-object-retention --bucket my-locked-bucket \ --key locked.txt \ --retention '{"Mode":"GOVERNANCE","RetainUntilDate":"2026-08-25T00:00:00Z"}' \ --endpoint-url=https://kr.ncloudstorage.com ``` ## 연관 명령어 연관 명령어는 다음과 같습니다. - [put-object-lock-configuration](/docs/put-object-lock-configuration) - [get-object-lock-configuration](/docs/get-object-lock-configuration) - [get-object-retention](/docs/get-object-retention) - [put-object-legal-hold](/docs/put-object-legal-hold) - [get-object-legal-hold](/docs/get-object-legal-hold)