AWS::S3::Bucket DefaultRetention
The container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.
Note
-
The
DefaultRetention
settings require both a mode and a period. -
The
DefaultRetention
period can be eitherDays
orYears
but you must select one. You cannot specifyDays
andYears
at the same time.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
Properties
Days
-
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 eitherDays
orYears
.Required: Conditional
Type: Integer
Update requires: No interruption
Mode
-
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 eitherDays
orYears
.Required: Conditional
Type: String
Allowed values:
COMPLIANCE | GOVERNANCE
Update requires: No interruption
Years
-
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 eitherDays
orYears
.Required: Conditional
Type: Integer
Update requires: No interruption
See also
-
AWS::S3::Bucket Examples