Class: AWSCDK::S3::CfnBucket::ObjectLockConfigurationProperty

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

Overview

Places an Object Lock configuration on the specified bucket.

The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object_lock_enabled: nil, rule: nil) ⇒ ObjectLockConfigurationProperty

Returns a new instance of ObjectLockConfigurationProperty.

Parameters:



2786
2787
2788
2789
2790
2791
# File 's3/cfn_bucket.rb', line 2786

def initialize(object_lock_enabled: nil, rule: nil)
  @object_lock_enabled = object_lock_enabled
  Jsii::Type.check_type(@object_lock_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "objectLockEnabled") unless @object_lock_enabled.nil?
  @rule = rule.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::ObjectLockRuleProperty.new(**rule.transform_keys(&:to_sym)) : rule
  Jsii::Type.check_type(@rule, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuT2JqZWN0TG9ja1J1bGVQcm9wZXJ0eSJ9XX19")), "rule") unless @rule.nil?
end

Instance Attribute Details

#object_lock_enabledString? (readonly)

Indicates whether this bucket has an Object Lock configuration enabled.

Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.



2799
2800
2801
# File 's3/cfn_bucket.rb', line 2799

def object_lock_enabled
  @object_lock_enabled
end

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

Specifies the Object Lock rule for the specified object.

Enable this rule when you apply ObjectLockConfiguration to a bucket. If Object Lock is turned on, bucket settings require both Mode and a period of either Days or Years . You cannot specify Days and Years at the same time. For more information, see ObjectLockRule and DefaultRetention .



2806
2807
2808
# File 's3/cfn_bucket.rb', line 2806

def rule
  @rule
end

Class Method Details

.jsii_propertiesObject



2808
2809
2810
2811
2812
2813
# File 's3/cfn_bucket.rb', line 2808

def self.jsii_properties
  {
    :object_lock_enabled => "objectLockEnabled",
    :rule => "rule",
  }
end

Instance Method Details

#to_jsiiObject



2815
2816
2817
2818
2819
2820
2821
2822
# File 's3/cfn_bucket.rb', line 2815

def to_jsii
  result = {}
  result.merge!({
    "objectLockEnabled" => @object_lock_enabled,
    "rule" => @rule,
  })
  result.compact
end