aws-cdk-lib.aws_s3.CfnBucket.DefaultRetentionProperty

interface DefaultRetentionProperty

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

The container element for specifying the default Object Lock retention settings for new objects placed in the specified bucket.

  • The DefaultRetention settings require both a mode and a period.
  • The DefaultRetention period can be either Days or Years but you must select one. You cannot specify Days and Years at the same time.

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 defaultRetentionProperty: s3.CfnBucket.DefaultRetentionProperty = {
  days: 123,
  mode: 'mode',
  years: 123,
};

Properties

NameTypeDescription
days?numberThe number of days that you want to specify for the default retention period.
mode?stringThe default Object Lock retention mode you want to apply to new objects placed in the specified bucket.
years?numberThe number of years that you want to specify for the default retention period.

days?

Type: number (optional)

The number of days that you want to specify for the default retention period.

If Object Lock is turned on, you must specify Mode and specify either Days or Years .


mode?

Type: string (optional)

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

If Object Lock is turned on, you must specify Mode and specify either Days or Years .


years?

Type: number (optional)

The number of years that you want to specify for the default retention period.

If Object Lock is turned on, you must specify Mode and specify either Days or Years .