This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
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
DefaultRetentionsettings require both a mode and a period. -
The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time.
Syntax
To declare this entity in your CloudFormation template, use the following syntax:
JSON
{ "Days" :Integer, "DefaultEventHold" :DefaultEventHold, "Mode" :String, "Years" :Integer}
YAML
Days:IntegerDefaultEventHold:DefaultEventHoldMode:StringYears:Integer
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
Modeand specify eitherDaysorYears.Required: Conditional
Type: Integer
Update requires: No interruption
DefaultEventHold-
The default Object Lock event hold duration that you want to apply to new objects placed in the specified bucket. When the event hold is released, Amazon S3 retains the object version for this duration.
Note
If you specify both a default retention period (
DaysorYears) and aDefaultEventHold, the event hold duration can't exceed the default retention period.Required: No
Type: DefaultEventHold
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
Modeand specify eitherDaysorYears.Required: Conditional
Type: String
Allowed values:
COMPLIANCE | GOVERNANCEUpdate 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
Modeand specify eitherDaysorYears.Required: Conditional
Type: Integer
Update requires: No interruption
See also
-
AWS::S3::Bucket Examples