interface DefaultRetentionProperty
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.S3.CfnBucket.DefaultRetentionProperty |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucket_DefaultRetentionProperty |
Java | software.amazon.awscdk.services.s3.CfnBucket.DefaultRetentionProperty |
Python | aws_cdk.aws_s3.CfnBucket.DefaultRetentionProperty |
TypeScript | aws-cdk-lib » aws_s3 » CfnBucket » DefaultRetentionProperty |
The container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.
- The
DefaultRetentionsettings require both a mode and a period.- The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat 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
| Name | Type | Description |
|---|---|---|
| days? | number | The number of days that you want to specify for the default retention period. |
| mode? | string | The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. |
| years? | number | The 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 .

.NET
Go
Java
Python
TypeScript