Class LifecycleRule.Builder

java.lang.Object
software.amazon.awscdk.services.s3.LifecycleRule.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<LifecycleRule>
Enclosing interface:
LifecycleRule

@Stability(Stable) public static final class LifecycleRule.Builder extends Object implements software.amazon.jsii.Builder<LifecycleRule>
A builder for LifecycleRule
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • abortIncompleteMultipartUploadAfter

      @Stability(Stable) public LifecycleRule.Builder abortIncompleteMultipartUploadAfter(Duration abortIncompleteMultipartUploadAfter)
      Parameters:
      abortIncompleteMultipartUploadAfter - 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.
      Returns:
      this
    • enabled

      @Stability(Stable) public LifecycleRule.Builder enabled(Boolean enabled)
      Sets the value of LifecycleRule.getEnabled()
      Parameters:
      enabled - Whether this rule is enabled.
      Returns:
      this
    • expiration

      @Stability(Stable) public LifecycleRule.Builder expiration(Duration expiration)
      Parameters:
      expiration - 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.
      Returns:
      this
    • expirationDate

      @Stability(Stable) public LifecycleRule.Builder expirationDate(Instant expirationDate)
      Parameters:
      expirationDate - 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.

      Returns:
      this
    • expiredObjectDeleteMarker

      @Stability(Stable) public LifecycleRule.Builder expiredObjectDeleteMarker(Boolean expiredObjectDeleteMarker)
      Parameters:
      expiredObjectDeleteMarker - Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired.
      Returns:
      this
    • id

      @Stability(Stable) public LifecycleRule.Builder id(String id)
      Sets the value of LifecycleRule.getId()
      Parameters:
      id - A unique identifier for this rule. The value cannot be more than 255 characters.
      Returns:
      this
    • noncurrentVersionExpiration

      @Stability(Stable) public LifecycleRule.Builder noncurrentVersionExpiration(Duration noncurrentVersionExpiration)
      Parameters:
      noncurrentVersionExpiration - 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.
      Returns:
      this
    • noncurrentVersionsToRetain

      @Stability(Stable) public LifecycleRule.Builder noncurrentVersionsToRetain(Number noncurrentVersionsToRetain)
      Parameters:
      noncurrentVersionsToRetain - Indicates a maximum number of noncurrent versions to retain. If there are this many more noncurrent versions, Amazon S3 permanently deletes them.
      Returns:
      this
    • noncurrentVersionTransitions

      @Stability(Stable) public LifecycleRule.Builder noncurrentVersionTransitions(List<? extends NoncurrentVersionTransition> noncurrentVersionTransitions)
      Parameters:
      noncurrentVersionTransitions - 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.

      Returns:
      this
    • objectSizeGreaterThan

      @Stability(Stable) public LifecycleRule.Builder objectSizeGreaterThan(Number objectSizeGreaterThan)
      Parameters:
      objectSizeGreaterThan - Specifies the minimum object size in bytes for this rule to apply to.
      Returns:
      this
    • objectSizeLessThan

      @Stability(Stable) public LifecycleRule.Builder objectSizeLessThan(Number objectSizeLessThan)
      Parameters:
      objectSizeLessThan - Specifies the maximum object size in bytes for this rule to apply to.
      Returns:
      this
    • prefix

      @Stability(Stable) public LifecycleRule.Builder prefix(String prefix)
      Sets the value of LifecycleRule.getPrefix()
      Parameters:
      prefix - Object key prefix that identifies one or more objects to which this rule applies.
      Returns:
      this
    • tagFilters

      @Stability(Stable) public LifecycleRule.Builder tagFilters(Map<String,? extends Object> tagFilters)
      Parameters:
      tagFilters - The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.
      Returns:
      this
    • transitions

      @Stability(Stable) public LifecycleRule.Builder transitions(List<? extends Transition> transitions)
      Parameters:
      transitions - 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.
      Returns:
      this
    • build

      @Stability(Stable) public LifecycleRule build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<LifecycleRule>
      Returns:
      a new instance of LifecycleRule
      Throws:
      NullPointerException - if any required attribute was not provided