aws-cdk-lib.aws_s3.CfnBucket.ObjectLockConfigurationProperty

interface ObjectLockConfigurationProperty

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

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. For more information, see Locking Objects .

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 objectLockConfigurationProperty: s3.CfnBucket.ObjectLockConfigurationProperty = {
  objectLockEnabled: 'objectLockEnabled',
  rule: {
    defaultRetention: {
      days: 123,
      mode: 'mode',
      years: 123,
    },
  },
};

Properties

NameTypeDescription
objectLockEnabled?stringIndicates whether this bucket has an Object Lock configuration enabled.
rule?IResolvable | ObjectLockRulePropertySpecifies the Object Lock rule for the specified object.

objectLockEnabled?

Type: string (optional)

Indicates whether this bucket has an Object Lock configuration enabled.

Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.


rule?

Type: IResolvable | ObjectLockRuleProperty (optional)

Specifies the Object Lock rule for the specified object.

Enable this rule when you apply ObjectLockConfiguration to a 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, see ObjectLockRule and DefaultRetention .