Class: AWSCDK::S3Express::CfnDirectoryBucket::RuleProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3_express/cfn_directory_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 . For examples, see Put Bucket Lifecycle Configuration Examples .

You must specify at least one of the following properties: AbortIncompleteMultipartUpload , or ExpirationInDays .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, abort_incomplete_multipart_upload: nil, expiration_in_days: nil, id: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: 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::S3Express::CfnDirectoryBucket::AbortIncompleteMultipartUploadProperty, nil) (defaults to: nil)

    Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.

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

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

    Unique identifier for the rule.

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

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

  • object_size_less_than (String, 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.



1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
# File 's3_express/cfn_directory_bucket.rb', line 1008

def initialize(status:, abort_incomplete_multipart_upload: nil, expiration_in_days: nil, id: nil, object_size_greater_than: nil, object_size_less_than: nil, prefix: 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::S3Express::CfnDirectoryBucket::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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zM2V4cHJlc3MuQ2ZuRGlyZWN0b3J5QnVja2V0LkFib3J0SW5jb21wbGV0ZU11bHRpcGFydFVwbG9hZFByb3BlcnR5In1dfX0=")), "abortIncompleteMultipartUpload") unless @abort_incomplete_multipart_upload.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?
  @id = id
  Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") unless @id.nil?
  @object_size_greater_than = object_size_greater_than
  Jsii::Type.check_type(@object_size_greater_than, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "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("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectSizeLessThan") unless @object_size_less_than.nil?
  @prefix = prefix
  Jsii::Type.check_type(@prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "prefix") unless @prefix.nil?
end

Instance Attribute Details

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

Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.



1036
1037
1038
# File 's3_express/cfn_directory_bucket.rb', line 1036

def abort_incomplete_multipart_upload
  @abort_incomplete_multipart_upload
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.



1043
1044
1045
# File 's3_express/cfn_directory_bucket.rb', line 1043

def expiration_in_days
  @expiration_in_days
end

#idString? (readonly)

Unique identifier for the rule.

The value can't be longer than 255 characters.



1050
1051
1052
# File 's3_express/cfn_directory_bucket.rb', line 1050

def id
  @id
end

#object_size_greater_thanString? (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 .



1057
1058
1059
# File 's3_express/cfn_directory_bucket.rb', line 1057

def object_size_greater_than
  @object_size_greater_than
end

#object_size_less_thanString? (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 .



1064
1065
1066
# File 's3_express/cfn_directory_bucket.rb', line 1064

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 .



1071
1072
1073
# File 's3_express/cfn_directory_bucket.rb', line 1071

def prefix
  @prefix
end

#statusString (readonly)

If Enabled , the rule is currently being applied.

If Disabled , the rule is not currently being applied.



1031
1032
1033
# File 's3_express/cfn_directory_bucket.rb', line 1031

def status
  @status
end

Class Method Details

.jsii_propertiesObject



1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
# File 's3_express/cfn_directory_bucket.rb', line 1073

def self.jsii_properties
  {
    :status => "status",
    :abort_incomplete_multipart_upload => "abortIncompleteMultipartUpload",
    :expiration_in_days => "expirationInDays",
    :id => "id",
    :object_size_greater_than => "objectSizeGreaterThan",
    :object_size_less_than => "objectSizeLessThan",
    :prefix => "prefix",
  }
end

Instance Method Details

#to_jsiiObject



1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 's3_express/cfn_directory_bucket.rb', line 1085

def to_jsii
  result = {}
  result.merge!({
    "status" => @status,
    "abortIncompleteMultipartUpload" => @abort_incomplete_multipart_upload,
    "expirationInDays" => @expiration_in_days,
    "id" => @id,
    "objectSizeGreaterThan" => @object_size_greater_than,
    "objectSizeLessThan" => @object_size_less_than,
    "prefix" => @prefix,
  })
  result.compact
end