Class: AWSCDK::S3::CfnBucket::RuleProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3/cfn_bucket.rb

Overview

Specifies lifecycle rules for an Amazon S3 bucket.

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 .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, abort_incomplete_multipart_upload: nil, expiration_date: nil, expiration_in_days: nil, expired_object_delete_marker: nil, id: nil, noncurrent_version_expiration: nil, noncurrent_version_expiration_in_days: nil, noncurrent_version_transition: nil, noncurrent_version_transitions: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: nil, tag_filters: nil, transition: nil, transitions: nil) ⇒ RuleProperty

Returns a new instance of RuleProperty.

Parameters:

  • status (String)

    If Enabled , the rule is currently being applied.

  • abort_incomplete_multipart_upload (AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::AbortIncompleteMultipartUploadProperty, nil) (defaults to: nil)

    Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.

  • expiration_date (DateTime, AWSCDK::IResolvable, nil) (defaults to: nil)

    Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.

  • expiration_in_days (Numeric, nil) (defaults to: nil)

    Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.

  • expired_object_delete_marker (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.

  • id (String, nil) (defaults to: nil)

    Unique identifier for the rule.

  • noncurrent_version_expiration (AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::NoncurrentVersionExpirationProperty, nil) (defaults to: nil)

    Specifies when noncurrent object versions expire.

  • noncurrent_version_expiration_in_days (Numeric, nil) (defaults to: nil)

    (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.

  • noncurrent_version_transition (AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::NoncurrentVersionTransitionProperty, nil) (defaults to: nil)

    (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 the NoncurrentVersionTransitions property.

  • noncurrent_version_transitions (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::NoncurrentVersionTransitionProperty>, nil) (defaults to: nil)

    For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.

  • object_size_greater_than (Numeric, nil) (defaults to: nil)

    Specifies the minimum object size in bytes for this rule to apply to.

  • object_size_less_than (Numeric, nil) (defaults to: nil)

    Specifies the maximum object size in bytes for this rule to apply to.

  • prefix (String, nil) (defaults to: nil)

    Object key prefix that identifies one or more objects to which this rule applies.

  • tag_filters (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::TagFilterProperty>, nil) (defaults to: nil)

    Tags to use to identify a subset of objects to which the lifecycle rule applies.

  • transition (AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::TransitionProperty, nil) (defaults to: nil)

    (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 the Transitions property.

  • transitions (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::TransitionProperty>, nil) (defaults to: nil)

    One or more transition rules that specify when an object transitions to a specified storage class.



3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
# File 's3/cfn_bucket.rb', line 3932

def initialize(status:, abort_incomplete_multipart_upload: nil, expiration_date: nil, expiration_in_days: nil, expired_object_delete_marker: nil, id: nil, noncurrent_version_expiration: nil, noncurrent_version_expiration_in_days: nil, noncurrent_version_transition: nil, noncurrent_version_transitions: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: nil, tag_filters: nil, transition: nil, transitions: nil)
  @status = status
  Jsii::Type.check_type(@status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "status")
  @abort_incomplete_multipart_upload = abort_incomplete_multipart_upload.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::AbortIncompleteMultipartUploadProperty.new(**abort_incomplete_multipart_upload.transform_keys(&:to_sym)) : abort_incomplete_multipart_upload
  Jsii::Type.check_type(@abort_incomplete_multipart_upload, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuQWJvcnRJbmNvbXBsZXRlTXVsdGlwYXJ0VXBsb2FkUHJvcGVydHkifV19fQ==")), "abortIncompleteMultipartUpload") unless @abort_incomplete_multipart_upload.nil?
  @expiration_date = expiration_date
  Jsii::Type.check_type(@expiration_date, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiZGF0ZSJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "expirationDate") unless @expiration_date.nil?
  @expiration_in_days = expiration_in_days
  Jsii::Type.check_type(@expiration_in_days, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "expirationInDays") unless @expiration_in_days.nil?
  @expired_object_delete_marker = expired_object_delete_marker
  Jsii::Type.check_type(@expired_object_delete_marker, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "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.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::NoncurrentVersionExpirationProperty.new(**noncurrent_version_expiration.transform_keys(&:to_sym)) : noncurrent_version_expiration
  Jsii::Type.check_type(@noncurrent_version_expiration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTm9uY3VycmVudFZlcnNpb25FeHBpcmF0aW9uUHJvcGVydHkifV19fQ==")), "noncurrentVersionExpiration") unless @noncurrent_version_expiration.nil?
  @noncurrent_version_expiration_in_days = noncurrent_version_expiration_in_days
  Jsii::Type.check_type(@noncurrent_version_expiration_in_days, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "noncurrentVersionExpirationInDays") unless @noncurrent_version_expiration_in_days.nil?
  @noncurrent_version_transition = noncurrent_version_transition.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::NoncurrentVersionTransitionProperty.new(**noncurrent_version_transition.transform_keys(&:to_sym)) : noncurrent_version_transition
  Jsii::Type.check_type(@noncurrent_version_transition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTm9uY3VycmVudFZlcnNpb25UcmFuc2l0aW9uUHJvcGVydHkifV19fQ==")), "noncurrentVersionTransition") unless @noncurrent_version_transition.nil?
  @noncurrent_version_transitions = noncurrent_version_transitions
  Jsii::Type.check_type(@noncurrent_version_transitions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0Lk5vbmN1cnJlbnRWZXJzaW9uVHJhbnNpdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LlRhZ0ZpbHRlclByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "tagFilters") unless @tag_filters.nil?
  @transition = transition.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::TransitionProperty.new(**transition.transform_keys(&:to_sym)) : transition
  Jsii::Type.check_type(@transition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuVHJhbnNpdGlvblByb3BlcnR5In1dfX0=")), "transition") unless @transition.nil?
  @transitions = transitions
  Jsii::Type.check_type(@transitions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LlRyYW5zaXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "transitions") unless @transitions.nil?
end

Instance Attribute Details

#abort_incomplete_multipart_uploadAWSCDK::IResolvable, ... (readonly)

Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.



3978
3979
3980
# File 's3/cfn_bucket.rb', line 3978

def abort_incomplete_multipart_upload
  @abort_incomplete_multipart_upload
end

#expiration_dateDateTime, ... (readonly)

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.



3985
3986
3987
# File 's3/cfn_bucket.rb', line 3985

def expiration_date
  @expiration_date
end

#expiration_in_daysNumeric? (readonly)

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.



3992
3993
3994
# File 's3/cfn_bucket.rb', line 3992

def expiration_in_days
  @expiration_in_days
end

#expired_object_delete_markerBoolean, ... (readonly)

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 , or TagFilters .



3999
4000
4001
# File 's3/cfn_bucket.rb', line 3999

def expired_object_delete_marker
  @expired_object_delete_marker
end

#idString? (readonly)

Unique identifier for the rule.

The value can't be longer than 255 characters.



4006
4007
4008
# File 's3/cfn_bucket.rb', line 4006

def id
  @id
end

#noncurrent_version_expirationAWSCDK::IResolvable, ... (readonly)

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.



4013
4014
4015
# File 's3/cfn_bucket.rb', line 4013

def noncurrent_version_expiration
  @noncurrent_version_expiration
end

#noncurrent_version_expiration_in_daysNumeric? (readonly)

(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.



4018
4019
4020
# File 's3/cfn_bucket.rb', line 4018

def noncurrent_version_expiration_in_days
  @noncurrent_version_expiration_in_days
end

#noncurrent_version_transitionAWSCDK::IResolvable, ... (readonly)

(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 the NoncurrentVersionTransitions property.



4023
4024
4025
# File 's3/cfn_bucket.rb', line 4023

def noncurrent_version_transition
  @noncurrent_version_transition
end

#noncurrent_version_transitionsAWSCDK::IResolvable, ... (readonly)

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 NoncurrentVersionTransition property.



4030
4031
4032
# File 's3/cfn_bucket.rb', line 4030

def noncurrent_version_transitions
  @noncurrent_version_transitions
end

#object_size_greater_thanNumeric? (readonly)

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 .



4037
4038
4039
# File 's3/cfn_bucket.rb', line 4037

def object_size_greater_than
  @object_size_greater_than
end

#object_size_less_thanNumeric? (readonly)

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 .



4044
4045
4046
# File 's3/cfn_bucket.rb', line 4044

def object_size_less_than
  @object_size_less_than
end

#prefixString? (readonly)

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 .



4051
4052
4053
# File 's3/cfn_bucket.rb', line 4051

def prefix
  @prefix
end

#statusString (readonly)

If Enabled , the rule is currently being applied.

If Disabled , the rule is not currently being applied.



3973
3974
3975
# File 's3/cfn_bucket.rb', line 3973

def status
  @status
end

#tag_filtersAWSCDK::IResolvable, ... (readonly)

Tags to use to identify a subset of objects to which the lifecycle rule applies.



4056
4057
4058
# File 's3/cfn_bucket.rb', line 4056

def tag_filters
  @tag_filters
end

#transitionAWSCDK::IResolvable, ... (readonly)

(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 the Transitions property.



4061
4062
4063
# File 's3/cfn_bucket.rb', line 4061

def transition
  @transition
end

#transitionsAWSCDK::IResolvable, ... (readonly)

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 Transition property.



4068
4069
4070
# File 's3/cfn_bucket.rb', line 4068

def transitions
  @transitions
end

Class Method Details

.jsii_propertiesObject



4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
# File 's3/cfn_bucket.rb', line 4070

def self.jsii_properties
  {
    :status => "status",
    :abort_incomplete_multipart_upload => "abortIncompleteMultipartUpload",
    :expiration_date => "expirationDate",
    :expiration_in_days => "expirationInDays",
    :expired_object_delete_marker => "expiredObjectDeleteMarker",
    :id => "id",
    :noncurrent_version_expiration => "noncurrentVersionExpiration",
    :noncurrent_version_expiration_in_days => "noncurrentVersionExpirationInDays",
    :noncurrent_version_transition => "noncurrentVersionTransition",
    :noncurrent_version_transitions => "noncurrentVersionTransitions",
    :object_size_greater_than => "objectSizeGreaterThan",
    :object_size_less_than => "objectSizeLessThan",
    :prefix => "prefix",
    :tag_filters => "tagFilters",
    :transition => "transition",
    :transitions => "transitions",
  }
end

Instance Method Details

#to_jsiiObject



4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
# File 's3/cfn_bucket.rb', line 4091

def to_jsii
  result = {}
  result.merge!({
    "status" => @status,
    "abortIncompleteMultipartUpload" => @abort_incomplete_multipart_upload,
    "expirationDate" => @expiration_date,
    "expirationInDays" => @expiration_in_days,
    "expiredObjectDeleteMarker" => @expired_object_delete_marker,
    "id" => @id,
    "noncurrentVersionExpiration" => @noncurrent_version_expiration,
    "noncurrentVersionExpirationInDays" => @noncurrent_version_expiration_in_days,
    "noncurrentVersionTransition" => @noncurrent_version_transition,
    "noncurrentVersionTransitions" => @noncurrent_version_transitions,
    "objectSizeGreaterThan" => @object_size_greater_than,
    "objectSizeLessThan" => @object_size_less_than,
    "prefix" => @prefix,
    "tagFilters" => @tag_filters,
    "transition" => @transition,
    "transitions" => @transitions,
  })
  result.compact
end