Class: AWSCDK::S3::ObjectLockRetention
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::S3::ObjectLockRetention
- Defined in:
- s3/object_lock_retention.rb
Overview
The default retention settings for an S3 Object Lock configuration.
Class Method Summary collapse
-
.compliance(duration) ⇒ AWSCDK::S3::ObjectLockRetention
Configure for Compliance retention for a specified duration.
-
.governance(duration) ⇒ AWSCDK::S3::ObjectLockRetention
Configure for Governance retention for a specified duration.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#duration ⇒ AWSCDK::Duration
The default period for which objects should be retained.
-
#initialize(*args) ⇒ ObjectLockRetention
constructor
A new instance of ObjectLockRetention.
-
#mode ⇒ AWSCDK::S3::ObjectLockMode
The retention mode to use for the object lock configuration.
Constructor Details
#initialize(*args) ⇒ ObjectLockRetention
Returns a new instance of ObjectLockRetention.
10 11 12 |
# File 's3/object_lock_retention.rb', line 10 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_s3.ObjectLockRetention does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.compliance(duration) ⇒ AWSCDK::S3::ObjectLockRetention
Configure for Compliance retention for a specified duration.
When an object is locked in compliance mode, its retention mode can't be changed, and its retention period can't be shortened. Compliance mode helps ensure that an object version can't be overwritten or deleted for the duration of the retention period.
29 30 31 32 |
# File 's3/object_lock_retention.rb', line 29 def self.compliance(duration) Jsii::Type.check_type(duration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "duration") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_s3.ObjectLockRetention", "compliance", [duration]) end |
.governance(duration) ⇒ AWSCDK::S3::ObjectLockRetention
Configure for Governance retention for a specified duration.
With governance mode, you protect objects against being deleted by most users, but you can still grant some users permission to alter the retention settings or delete the object if necessary. You can also use governance mode to test retention-period settings before creating a compliance-mode retention period.
43 44 45 46 |
# File 's3/object_lock_retention.rb', line 43 def self.governance(duration) Jsii::Type.check_type(duration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "duration") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_s3.ObjectLockRetention", "governance", [duration]) end |
.jsii_overridable_methods ⇒ Object
14 15 16 17 18 19 |
# File 's3/object_lock_retention.rb', line 14 def self.jsii_overridable_methods { :duration => { kind: :property, name: "duration", is_optional: false }, :mode => { kind: :property, name: "mode", is_optional: false }, } end |
Instance Method Details
#duration ⇒ AWSCDK::Duration
The default period for which objects should be retained.
51 52 53 |
# File 's3/object_lock_retention.rb', line 51 def duration() jsii_get_property("duration") end |
#mode ⇒ AWSCDK::S3::ObjectLockMode
The retention mode to use for the object lock configuration.
59 60 61 |
# File 's3/object_lock_retention.rb', line 59 def mode() jsii_get_property("mode") end |