Class: AWSCDK::S3::LifecycleRule
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::S3::LifecycleRule
- Defined in:
- s3/lifecycle_rule.rb
Overview
Declaration of a Life cycle rule.
Instance Attribute Summary collapse
-
#abort_incomplete_multipart_upload_after ⇒ AWSCDK::Duration?
readonly
Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket.
-
#enabled ⇒ Boolean?
readonly
Whether this rule is enabled.
-
#expiration ⇒ AWSCDK::Duration?
readonly
Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon Glacier.
-
#expiration_date ⇒ DateTime?
readonly
Indicates when objects are deleted from Amazon S3 and Amazon Glacier.
-
#expired_object_delete_marker ⇒ Boolean?
readonly
Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions.
-
#id ⇒ String?
readonly
A unique identifier for this rule.
-
#noncurrent_version_expiration ⇒ AWSCDK::Duration?
readonly
Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire.
-
#noncurrent_version_transitions ⇒ Array<AWSCDK::S3::NoncurrentVersionTransition>?
readonly
One or more transition rules that specify when non-current objects transition to a specified storage class.
-
#noncurrent_versions_to_retain ⇒ Numeric?
readonly
Indicates a maximum number of noncurrent versions to retain.
-
#object_size_greater_than ⇒ Numeric?
readonly
Specifies the minimum object size in bytes for this rule to apply to.
-
#object_size_less_than ⇒ Numeric?
readonly
Specifies the maximum object size in bytes for this rule to apply to.
-
#prefix ⇒ String?
readonly
Object key prefix that identifies one or more objects to which this rule applies.
-
#tag_filters ⇒ Hash{String => Object}?
readonly
The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.
-
#transitions ⇒ Array<AWSCDK::S3::Transition>?
readonly
One or more transition rules that specify when an object transitions to a specified storage class.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(abort_incomplete_multipart_upload_after: nil, enabled: nil, expiration: nil, expiration_date: nil, expired_object_delete_marker: nil, id: nil, noncurrent_version_expiration: nil, noncurrent_versions_to_retain: nil, noncurrent_version_transitions: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: nil, tag_filters: nil, transitions: nil) ⇒ LifecycleRule
constructor
A new instance of LifecycleRule.
- #to_jsii ⇒ Object
Constructor Details
#initialize(abort_incomplete_multipart_upload_after: nil, enabled: nil, expiration: nil, expiration_date: nil, expired_object_delete_marker: nil, id: nil, noncurrent_version_expiration: nil, noncurrent_versions_to_retain: nil, noncurrent_version_transitions: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: nil, tag_filters: nil, transitions: nil) ⇒ LifecycleRule
Returns a new instance of LifecycleRule.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 's3/lifecycle_rule.rb', line 21 def initialize(abort_incomplete_multipart_upload_after: nil, enabled: nil, expiration: nil, expiration_date: nil, expired_object_delete_marker: nil, id: nil, noncurrent_version_expiration: nil, noncurrent_versions_to_retain: nil, noncurrent_version_transitions: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: nil, tag_filters: nil, transitions: nil) @abort_incomplete_multipart_upload_after = abort_incomplete_multipart_upload_after Jsii::Type.check_type(@abort_incomplete_multipart_upload_after, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "abortIncompleteMultipartUploadAfter") unless @abort_incomplete_multipart_upload_after.nil? @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @expiration = expiration Jsii::Type.check_type(@expiration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "expiration") unless @expiration.nil? @expiration_date = expiration_date Jsii::Type.check_type(@expiration_date, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "expirationDate") unless @expiration_date.nil? @expired_object_delete_marker = expired_object_delete_marker Jsii::Type.check_type(@expired_object_delete_marker, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "expiredObjectDeleteMarker") unless @expired_object_delete_marker.nil? @id = id Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") unless @id.nil? @noncurrent_version_expiration = noncurrent_version_expiration Jsii::Type.check_type(@noncurrent_version_expiration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "noncurrentVersionExpiration") unless @noncurrent_version_expiration.nil? @noncurrent_versions_to_retain = noncurrent_versions_to_retain Jsii::Type.check_type(@noncurrent_versions_to_retain, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "noncurrentVersionsToRetain") unless @noncurrent_versions_to_retain.nil? @noncurrent_version_transitions = noncurrent_version_transitions.is_a?(Array) ? noncurrent_version_transitions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::S3::NoncurrentVersionTransition.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : noncurrent_version_transitions Jsii::Type.check_type(@noncurrent_version_transitions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5Ob25jdXJyZW50VmVyc2lvblRyYW5zaXRpb24ifSwia2luZCI6ImFycmF5In19")), "noncurrentVersionTransitions") unless @noncurrent_version_transitions.nil? @object_size_greater_than = object_size_greater_than Jsii::Type.check_type(@object_size_greater_than, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "objectSizeGreaterThan") unless @object_size_greater_than.nil? @object_size_less_than = object_size_less_than Jsii::Type.check_type(@object_size_less_than, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "objectSizeLessThan") unless @object_size_less_than.nil? @prefix = prefix Jsii::Type.check_type(@prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "prefix") unless @prefix.nil? @tag_filters = tag_filters Jsii::Type.check_type(@tag_filters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "tagFilters") unless @tag_filters.nil? @transitions = transitions.is_a?(Array) ? transitions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::S3::Transition.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : transitions Jsii::Type.check_type(@transitions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5UcmFuc2l0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "transitions") unless @transitions.nil? end |
Instance Attribute Details
#abort_incomplete_multipart_upload_after ⇒ AWSCDK::Duration? (readonly)
Default: - Incomplete uploads are never aborted
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.
64 65 66 |
# File 's3/lifecycle_rule.rb', line 64 def abort_incomplete_multipart_upload_after @abort_incomplete_multipart_upload_after end |
#enabled ⇒ Boolean? (readonly)
Default: true
Whether this rule is enabled.
69 70 71 |
# File 's3/lifecycle_rule.rb', line 69 def enabled @enabled end |
#expiration ⇒ AWSCDK::Duration? (readonly)
Default: - No expiration timeout
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.
81 82 83 |
# File 's3/lifecycle_rule.rb', line 81 def expiration @expiration end |
#expiration_date ⇒ DateTime? (readonly)
Default: - No expiration date
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.
92 93 94 |
# File 's3/lifecycle_rule.rb', line 92 def expiration_date @expiration_date end |
#expired_object_delete_marker ⇒ Boolean? (readonly)
Default: false
Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions.
If set to true, the delete marker will be expired.
99 100 101 |
# File 's3/lifecycle_rule.rb', line 99 def expired_object_delete_marker @expired_object_delete_marker end |
#id ⇒ String? (readonly)
A unique identifier for this rule.
The value cannot be more than 255 characters.
105 106 107 |
# File 's3/lifecycle_rule.rb', line 105 def id @id end |
#noncurrent_version_expiration ⇒ AWSCDK::Duration? (readonly)
Default: - No noncurrent version expiration
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.
120 121 122 |
# File 's3/lifecycle_rule.rb', line 120 def noncurrent_version_expiration @noncurrent_version_expiration end |
#noncurrent_version_transitions ⇒ Array<AWSCDK::S3::NoncurrentVersionTransition>? (readonly)
One or more transition rules that specify when non-current objects transition to a specified storage class.
Only 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.
137 138 139 |
# File 's3/lifecycle_rule.rb', line 137 def noncurrent_version_transitions @noncurrent_version_transitions end |
#noncurrent_versions_to_retain ⇒ Numeric? (readonly)
Default: - No noncurrent versions to retain
Indicates a maximum number of noncurrent versions to retain.
If there are this many more noncurrent versions, Amazon S3 permanently deletes them.
128 129 130 |
# File 's3/lifecycle_rule.rb', line 128 def noncurrent_versions_to_retain @noncurrent_versions_to_retain end |
#object_size_greater_than ⇒ Numeric? (readonly)
Default: - No rule
Specifies the minimum object size in bytes for this rule to apply to.
Objects must be larger than this value in bytes.
144 145 146 |
# File 's3/lifecycle_rule.rb', line 144 def object_size_greater_than @object_size_greater_than end |
#object_size_less_than ⇒ Numeric? (readonly)
Default: - No rule
Specifies the maximum object size in bytes for this rule to apply to.
Objects must be smaller than this value in bytes.
151 152 153 |
# File 's3/lifecycle_rule.rb', line 151 def object_size_less_than @object_size_less_than end |
#prefix ⇒ String? (readonly)
Default: - Rule applies to all objects
Object key prefix that identifies one or more objects to which this rule applies.
156 157 158 |
# File 's3/lifecycle_rule.rb', line 156 def prefix @prefix end |
#tag_filters ⇒ Hash{String => Object}? (readonly)
Default: - Rule applies to all objects
The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.
161 162 163 |
# File 's3/lifecycle_rule.rb', line 161 def tag_filters @tag_filters end |
#transitions ⇒ Array<AWSCDK::S3::Transition>? (readonly)
Default: - No transition rules
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.
170 171 172 |
# File 's3/lifecycle_rule.rb', line 170 def transitions @transitions end |
Class Method Details
.jsii_properties ⇒ Object
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 's3/lifecycle_rule.rb', line 172 def self.jsii_properties { :abort_incomplete_multipart_upload_after => "abortIncompleteMultipartUploadAfter", :enabled => "enabled", :expiration => "expiration", :expiration_date => "expirationDate", :expired_object_delete_marker => "expiredObjectDeleteMarker", :id => "id", :noncurrent_version_expiration => "noncurrentVersionExpiration", :noncurrent_versions_to_retain => "noncurrentVersionsToRetain", :noncurrent_version_transitions => "noncurrentVersionTransitions", :object_size_greater_than => "objectSizeGreaterThan", :object_size_less_than => "objectSizeLessThan", :prefix => "prefix", :tag_filters => "tagFilters", :transitions => "transitions", } end |
Instance Method Details
#to_jsii ⇒ Object
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 's3/lifecycle_rule.rb', line 191 def to_jsii result = {} result.merge!({ "abortIncompleteMultipartUploadAfter" => @abort_incomplete_multipart_upload_after, "enabled" => @enabled, "expiration" => @expiration, "expirationDate" => @expiration_date, "expiredObjectDeleteMarker" => @expired_object_delete_marker, "id" => @id, "noncurrentVersionExpiration" => @noncurrent_version_expiration, "noncurrentVersionsToRetain" => @noncurrent_versions_to_retain, "noncurrentVersionTransitions" => @noncurrent_version_transitions, "objectSizeGreaterThan" => @object_size_greater_than, "objectSizeLessThan" => @object_size_less_than, "prefix" => @prefix, "tagFilters" => @tag_filters, "transitions" => @transitions, }) result.compact end |