public static interface CfnBucket.RuleProperty
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();
Modifier and Type | Interface and Description |
---|---|
static class |
CfnBucket.RuleProperty.Builder
A builder for
CfnBucket.RuleProperty |
static class |
CfnBucket.RuleProperty.Jsii$Proxy
An implementation for
CfnBucket.RuleProperty |
Modifier and Type | Method and Description |
---|---|
static CfnBucket.RuleProperty.Builder |
builder() |
default java.lang.Object |
getAbortIncompleteMultipartUpload()
Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.
|
default java.lang.Object |
getExpirationDate()
Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.
|
default java.lang.Number |
getExpirationInDays()
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.
|
default java.lang.Object |
getExpiredObjectDeleteMarker()
Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.
|
default java.lang.String |
getId()
Unique identifier for the rule.
|
default java.lang.Object |
getNoncurrentVersionExpiration()
Specifies when noncurrent object versions expire.
|
default java.lang.Number |
getNoncurrentVersionExpirationInDays()
(Deprecated.) 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.
|
default java.lang.Object |
getNoncurrentVersionTransition()
(Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class.
|
default java.lang.Object |
getNoncurrentVersionTransitions()
For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.
|
default java.lang.Number |
getObjectSizeGreaterThan()
Specifies the minimum object size in bytes for this rule to apply to.
|
default java.lang.Number |
getObjectSizeLessThan()
Specifies the maximum object size in bytes for this rule to apply to.
|
default java.lang.String |
getPrefix()
Object key prefix that identifies one or more objects to which this rule applies.
|
java.lang.String |
getStatus()
If `Enabled` , the rule is currently being applied.
|
default java.lang.Object |
getTagFilters()
Tags to use to identify a subset of objects to which the lifecycle rule applies.
|
default java.lang.Object |
getTransition()
(Deprecated.) Specifies when an object transitions to a specified storage class.
|
default java.lang.Object |
getTransitions()
One or more transition rules that specify when an object transitions to a specified storage class.
|
java.lang.String getStatus()
If Disabled
, the rule is not currently being applied.
default java.lang.Object getAbortIncompleteMultipartUpload()
default java.lang.Object getExpirationDate()
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 java.lang.Number getExpirationInDays()
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 java.lang.Object getExpiredObjectDeleteMarker()
If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified with ExpirationInDays
, ExpirationDate
, or TagFilters
.
default java.lang.String getId()
The value can't be longer than 255 characters.
default java.lang.Object getNoncurrentVersionExpiration()
Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime.
default java.lang.Number getNoncurrentVersionExpirationInDays()
default java.lang.Object getNoncurrentVersionTransition()
default java.lang.Object getNoncurrentVersionTransitions()
If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don't specify the NoncurrentVersionTransition
property.
default java.lang.Number getObjectSizeGreaterThan()
Objects must be larger than this value in bytes. For more information about size based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide .
default java.lang.Number getObjectSizeLessThan()
Objects must be smaller than this value in bytes. For more information about sized based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide .
default java.lang.String getPrefix()
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .
default java.lang.Object getTagFilters()
default java.lang.Object getTransition()
default java.lang.Object getTransitions()
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. If you specify this property, don't specify the Transition
property.
static CfnBucket.RuleProperty.Builder builder()
CfnBucket.RuleProperty.Builder
of CfnBucket.RuleProperty