Places an Object Retention configuration on an object. For more information, see Locking Objects.
Users or accounts require the s3:PutObjectRetention permission in order to place
an Object Retention configuration on objects. Bypassing a Governance Retention configuration
requires the s3:BypassGovernanceRetention permission.
This action is not supported by Amazon S3 on Outposts.
example
Use a bare-bones client and the command you need to make an API call.
Places an Object Retention configuration on an object. For more information, see Locking Objects. Users or accounts require the
s3:PutObjectRetention
permission in order to place an Object Retention configuration on objects. Bypassing a Governance Retention configuration requires thes3:BypassGovernanceRetention
permission.This action is not supported by Amazon S3 on Outposts.
Use a bare-bones client and the command you need to make an API call.
import { S3Client, PutObjectRetentionCommand } from "@aws-sdk/client-s3"; // ES Modules import // const { S3Client, PutObjectRetentionCommand } = require("@aws-sdk/client-s3"); // CommonJS import const client = new S3Client(config); const command = new PutObjectRetentionCommand(input); const response = await client.send(command);
PutObjectRetentionCommandInput for command's
input
shape.PutObjectRetentionCommandOutput for command's
response
shape.config for S3Client's
config
shape.