Amazon Simple Storage Service
API Reference (API Version 2006-03-01)
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with AWS services in China.

PUT Bucket object lock configuration

Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket.

Request Syntax

PUT /?object-lock HTTP/1.1 Host: <bucket-name> Date: <Thu, 15 Nov 2016 00:17:21 GMT> Authorization: <authorization-string> (see Authenticating Requests (AWS Signature Version 4)) <ObjectLockConfiguration> <ObjectLockEnabled><value></ObjectLockEnabled> <Rule> <DefaultRetention> <Mode><value></Mode> <Days><value></Days> <Years><value></Years> </DefaultRetention> </Rule> </ObjectLockConfiguration>


DefaultRetention requires either Days or Years. You can't specify both at the same time.

URI Request Parameters

The request does not use any URI parameters.

Request Body

For more information about the request elements that this operation uses, see ObjectLockConfiguration.

Example Request Body:

<ObjectLockConfiguration> <ObjectLockEnabled>Enabled</ObjectLockEnabled> <Rule> <DefaultRetention> <Mode>GOVERNANCE</Mode> <Days>30</Days> </DefaultRetention> </Rule> </ObjectLockConfiguration>

Response Syntax

HTTP/1.1 200

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

Related Resources

Locking Objects in the Amazon Simple Storage Service Developer Guide.