Interface CfnBucket.RuleProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnBucket.RuleProperty.Jsii$Proxy
- Enclosing class:
CfnBucket
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:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnBucket.RulePropertystatic final classAn implementation forCfnBucket.RuleProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default ObjectSpecifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.default ObjectIndicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.default NumberIndicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.default ObjectIndicates whether Amazon S3 will remove a delete marker without any noncurrent versions.default StringgetId()Unique identifier for the rule.default ObjectSpecifies when noncurrent object versions expire.default Number(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 Object(Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class.default ObjectFor buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.default NumberSpecifies the minimum object size in bytes for this rule to apply to.default NumberSpecifies the maximum object size in bytes for this rule to apply to.default StringObject key prefix that identifies one or more objects to which this rule applies.IfEnabled, the rule is currently being applied.default ObjectTags to use to identify a subset of objects to which the lifecycle rule applies.default Object(Deprecated.) Specifies when an object transitions to a specified storage class.default ObjectOne 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
-
getStatus
IfEnabled, the rule is currently being applied.If
Disabled, the rule is not currently being applied.- See Also:
-
getAbortIncompleteMultipartUpload
Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.Returns union: either
IResolvableorCfnBucket.AbortIncompleteMultipartUploadProperty- See Also:
-
getExpirationDate
Indicates when objects are deleted from Amazon S3 and Amazon S3 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.
Returns union: either
InstantorIResolvable- See Also:
-
getExpirationInDays
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 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.
- See Also:
-
getExpiredObjectDeleteMarker
Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified with
ExpirationInDays,ExpirationDate, orTagFilters.Returns union: either
BooleanorIResolvable- See Also:
-
getId
Unique identifier for the rule.The value can't be longer than 255 characters.
- See Also:
-
getNoncurrentVersionExpiration
Specifies when noncurrent object versions expire.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.
Returns union: either
IResolvableorCfnBucket.NoncurrentVersionExpirationProperty- See Also:
-
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. 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.- See Also:
-
getNoncurrentVersionTransition
(Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class. 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 theNoncurrentVersionTransitionsproperty.Returns union: either
IResolvableorCfnBucket.NoncurrentVersionTransitionProperty- See Also:
-
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.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
NoncurrentVersionTransitionproperty.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnBucket.NoncurrentVersionTransitionProperty>- See Also:
-
getObjectSizeGreaterThan
Specifies the minimum object size in bytes for this rule to apply to.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 .
- See Also:
-
getObjectSizeLessThan
Specifies the maximum object size in bytes for this rule to apply to.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 .
- See Also:
-
getPrefix
Object key prefix that identifies one or more objects to which this rule applies.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 .
- See Also:
-
getTagFilters
Tags to use to identify a subset of objects to which the lifecycle rule applies.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnBucket.TagFilterProperty>- See Also:
-
getTransition
(Deprecated.) Specifies 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. If you specify this property, don't specify theTransitionsproperty.Returns union: either
IResolvableorCfnBucket.TransitionProperty- See Also:
-
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. If you specify this property, don't specify the
Transitionproperty.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnBucket.TransitionProperty>- See Also:
-
builder
- Returns:
- a
CfnBucket.RuleProperty.BuilderofCfnBucket.RuleProperty
-