Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PutObjectRetentionCommand

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.

Permissions

When the Object Lock retention mode is set to compliance, you need s3:PutObjectRetention and s3:BypassGovernanceRetention permissions. For other requests to PutObjectRetention, only s3:PutObjectRetention permissions are required.

example

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);
see

PutObjectRetentionCommandInput for command's input shape.

see

PutObjectRetentionCommandOutput for command's response shape.

see

config for S3Client's config shape.

Hierarchy

Implements

Index

Constructors

Properties

Constructors

constructor

Properties

Readonly input

input: PutObjectRetentionCommandInput

Readonly middlewareStack