Interface CfnBucket.DefaultRetentionProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnBucket.DefaultRetentionProperty.Jsii$Proxy
Enclosing class:
CfnBucket

@Stability(Stable) public static interface CfnBucket.DefaultRetentionProperty extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.services.s3.*;
 DefaultRetentionProperty defaultRetentionProperty = DefaultRetentionProperty.builder()
         .days(123)
         .mode("mode")
         .years(123)
         .build();
 
  • Method Details

    • getDays

      @Stability(Stable) @Nullable default Number getDays()
      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 .

    • getMode

      @Stability(Stable) @Nullable default String getMode()
      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 .

    • getYears

      @Stability(Stable) @Nullable default Number getYears()
      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 .

    • builder

      @Stability(Stable) static CfnBucket.DefaultRetentionProperty.Builder builder()
      Returns:
      a CfnBucket.DefaultRetentionProperty.Builder of CfnBucket.DefaultRetentionProperty