DefaultRetentionProperty Struct
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.
| Source | |
|---|---|
| Type last changed |
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,
defaultEventHold: {
days: 123,
years: 123,
},
mode: 'mode',
years: 123,
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_s3 as s3
default_retention_property = s3.CfnBucket.DefaultRetentionProperty(
days=123,
default_event_hold=s3.CfnBucket.DefaultEventHoldProperty(
days=123,
years=123
),
mode="mode",
years=123
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.s3.*;
DefaultRetentionProperty defaultRetentionProperty = DefaultRetentionProperty.builder()
.days(123)
.defaultEventHold(DefaultEventHoldProperty.builder()
.days(123)
.years(123)
.build())
.mode("mode")
.years(123)
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;
var defaultRetentionProperty = new DefaultRetentionProperty {
Days = 123,
DefaultEventHold = new DefaultEventHoldProperty {
Days = 123,
Years = 123
},
Mode = "mode",
Years = 123
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
defaultRetentionProperty := &DefaultRetentionProperty{
Days: jsii.Number(123),
DefaultEventHold: &DefaultEventHoldProperty{
Days: jsii.Number(123),
Years: jsii.Number(123),
},
Mode: jsii.String("mode"),
Years: jsii.Number(123),
}
Properties
If Object Lock is turned on, you must specify Mode and specify either Days or Years .
defaultEventHoldoptionalIResolvable | CfnBucket.default_event_holdoptionaltyping.Union[IResolvable, DefaultEventHoldProperty]defaultEventHoldoptionalIResolvableDefaultEventHoldoptionalIResolvableDefaultEventHoldoptionalinterface{} #notes
New object versions are placed under an event hold and remain protected while the hold is active. When the event hold is released, Amazon S3 retains the object version for this duration, measured from the time the hold is released. The DefaultEventHold duration can be specified in either Days or Years, but you must select one. You can't specify Days and Years at the same time.
If Object Lock is turned on, you must specify Mode and specify either Days or Years .
yearsoptionalnumberyearsoptionalint | floatyearsoptionalNumberYearsoptionaldoubleYearsoptional*float64 #If Object Lock is turned on, you must specify Mode and specify either Days or Years .