Interface LifecycleRule
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
LifecycleRule.Jsii$Proxy
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.*; import software.amazon.awscdk.services.s3.*; StorageClass storageClass; Object tagFilters; LifecycleRule lifecycleRule = LifecycleRule.builder() .abortIncompleteMultipartUploadAfter(Duration.minutes(30)) .enabled(false) .expiration(Duration.minutes(30)) .expirationDate(new Date()) .expiredObjectDeleteMarker(false) .id("id") .noncurrentVersionExpiration(Duration.minutes(30)) .noncurrentVersionsToRetain(123) .noncurrentVersionTransitions(List.of(NoncurrentVersionTransition.builder() .storageClass(storageClass) .transitionAfter(Duration.minutes(30)) // the properties below are optional .noncurrentVersionsToRetain(123) .build())) .objectSizeGreaterThan(123) .objectSizeLessThan(123) .prefix("prefix") .tagFilters(Map.of( "tagFiltersKey", tagFilters)) .transitions(List.of(Transition.builder() .storageClass(storageClass) // the properties below are optional .transitionAfter(Duration.minutes(30)) .transitionDate(new Date()) .build())) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forLifecycleRule
static final class
An implementation forLifecycleRule
-
Method Summary
Modifier and TypeMethodDescriptionstatic LifecycleRule.Builder
builder()
default Duration
Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket.default Boolean
Whether this rule is enabled.default Duration
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon Glacier.default Instant
Indicates when objects are deleted from Amazon S3 and Amazon Glacier.default Boolean
Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions.default String
getId()
A unique identifier for this rule.default Duration
Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire.default Number
Indicates a maximum number of noncurrent versions to retain.default List<NoncurrentVersionTransition>
One or more transition rules that specify when non-current objects transition to a specified storage class.default Number
Specifies the minimum object size in bytes for this rule to apply to.default Number
Specifies the maximum object size in bytes for this rule to apply to.default String
Object key prefix that identifies one or more objects to which this rule applies.The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.default List<Transition>
One or more transition rules that specify when an object transitions to a specified storage class.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAbortIncompleteMultipartUploadAfter
Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket.The AbortIncompleteMultipartUpload property type creates a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket. When Amazon S3 aborts a multipart upload, it deletes all parts associated with the multipart upload.
The underlying configuration is expressed in whole numbers of days. Providing a Duration that does not represent a whole number of days will result in a runtime or deployment error.
Default: - Incomplete uploads are never aborted
-
getEnabled
Whether this rule is enabled.Default: true
-
getExpiration
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon Glacier.If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
The underlying configuration is expressed in whole numbers of days. Providing a Duration that does not represent a whole number of days will result in a runtime or deployment error.
Default: - No expiration timeout
-
getExpirationDate
Indicates when objects are deleted from Amazon S3 and Amazon Glacier.The date value must be in ISO 8601 format. The time is always midnight UTC.
If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
Default: - No expiration date
-
getExpiredObjectDeleteMarker
Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions.If set to true, the delete marker will be expired.
Default: false
-
getId
A unique identifier for this rule.The value cannot be more than 255 characters.
-
getNoncurrentVersionExpiration
Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire.For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.
The underlying configuration is expressed in whole numbers of days. Providing a Duration that does not represent a whole number of days will result in a runtime or deployment error.
Default: - No noncurrent version expiration
-
getNoncurrentVersionsToRetain
Indicates a maximum number of noncurrent versions to retain.If there are this many more noncurrent versions, Amazon S3 permanently deletes them.
Default: - No noncurrent versions to retain
-
getNoncurrentVersionTransitions
@Stability(Stable) @Nullable default List<NoncurrentVersionTransition> getNoncurrentVersionTransitions()One or more transition rules that specify when non-current objects transition to a specified storage class.Only for for buckets with versioning enabled (or suspended).
If you specify a transition and expiration time, the expiration time must be later than the transition time.
-
getObjectSizeGreaterThan
Specifies the minimum object size in bytes for this rule to apply to.Objects must be larger than this value in bytes.
Default: - No rule
-
getObjectSizeLessThan
Specifies the maximum object size in bytes for this rule to apply to.Objects must be smaller than this value in bytes.
Default: - No rule
-
getPrefix
Object key prefix that identifies one or more objects to which this rule applies.Default: - Rule applies to all objects
-
getTagFilters
The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.Default: - Rule applies to all objects
-
getTransitions
One or more transition rules that specify when an object transitions to a specified storage class.If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
Default: - No transition rules
-
builder
- Returns:
- a
LifecycleRule.Builder
ofLifecycleRule
-