Interface CfnBucket.RuleProperty

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

@Stability(Stable) public static interface CfnBucket.RuleProperty extends software.amazon.jsii.JsiiSerializable
Specifies lifecycle rules for an Amazon S3 bucket.

For more information, see Put Bucket Lifecycle Configuration in the Amazon S3 API Reference .

You must specify at least one of the following properties: AbortIncompleteMultipartUpload , ExpirationDate , ExpirationInDays , NoncurrentVersionExpirationInDays , NoncurrentVersionTransition , NoncurrentVersionTransitions , Transition , or Transitions .

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.*;
 RuleProperty ruleProperty = RuleProperty.builder()
         .status("status")
         // the properties below are optional
         .abortIncompleteMultipartUpload(AbortIncompleteMultipartUploadProperty.builder()
                 .daysAfterInitiation(123)
                 .build())
         .expirationDate(new Date())
         .expirationInDays(123)
         .expiredObjectDeleteMarker(false)
         .id("id")
         .noncurrentVersionExpiration(NoncurrentVersionExpirationProperty.builder()
                 .noncurrentDays(123)
                 // the properties below are optional
                 .newerNoncurrentVersions(123)
                 .build())
         .noncurrentVersionExpirationInDays(123)
         .noncurrentVersionTransition(NoncurrentVersionTransitionProperty.builder()
                 .storageClass("storageClass")
                 .transitionInDays(123)
                 // the properties below are optional
                 .newerNoncurrentVersions(123)
                 .build())
         .noncurrentVersionTransitions(List.of(NoncurrentVersionTransitionProperty.builder()
                 .storageClass("storageClass")
                 .transitionInDays(123)
                 // the properties below are optional
                 .newerNoncurrentVersions(123)
                 .build()))
         .objectSizeGreaterThan(123)
         .objectSizeLessThan(123)
         .prefix("prefix")
         .tagFilters(List.of(TagFilterProperty.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .transition(TransitionProperty.builder()
                 .storageClass("storageClass")
                 // the properties below are optional
                 .transitionDate(new Date())
                 .transitionInDays(123)
                 .build())
         .transitions(List.of(TransitionProperty.builder()
                 .storageClass("storageClass")
                 // the properties below are optional
                 .transitionDate(new Date())
                 .transitionInDays(123)
                 .build()))
         .build();
 

See Also: