interface ObjectLockRuleProperty
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.S3.CfnBucket.ObjectLockRuleProperty |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucket_ObjectLockRuleProperty |
Java | software.amazon.awscdk.services.s3.CfnBucket.ObjectLockRuleProperty |
Python | aws_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
| Name | Type | Description |
|---|---|---|
| default | IResolvable | Default | The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket. |
defaultRetention?
Type:
IResolvable | Default
(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 .

.NET
Go
Java
Python
TypeScript