aws-cdk-lib.aws_s3.CfnBucket.ObjectLockRuleProperty

interface ObjectLockRuleProperty

LanguageType name
.NETAmazon.CDK.AWS.S3.CfnBucket.ObjectLockRuleProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucket_ObjectLockRuleProperty
Javasoftware.amazon.awscdk.services.s3.CfnBucket.ObjectLockRuleProperty
Pythonaws_cdk.aws_s3.CfnBucket.ObjectLockRuleProperty
TypeScript aws-cdk-lib » aws_s3 » CfnBucket » ObjectLockRuleProperty

Specifies the Object Lock rule for the specified object.

Enable the this rule when you apply ObjectLockConfiguration to a bucket.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
const objectLockRuleProperty: s3.CfnBucket.ObjectLockRuleProperty = {
  defaultRetention: {
    days: 123,
    mode: 'mode',
    years: 123,
  },
};

Properties

NameTypeDescription
defaultRetention?IResolvable | DefaultRetentionPropertyThe default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket.

defaultRetention?

Type: IResolvable | DefaultRetentionProperty (optional)

The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket.

If Object Lock is turned on, bucket settings require both Mode and a period of either Days or Years . You cannot specify Days and Years at the same time. For more information about allowable values for mode and period, see DefaultRetention .