interface ObjectLockConfigurationProperty
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.S3.CfnBucket.ObjectLockConfigurationProperty |
Java | software.amazon.awscdk.services.s3.CfnBucket.ObjectLockConfigurationProperty |
Python | aws_cdk.aws_s3.CfnBucket.ObjectLockConfigurationProperty |
TypeScript | @aws-cdk/aws-s3 » CfnBucket » ObjectLockConfigurationProperty |
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 .
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as s3 from '@aws-cdk/aws-s3';
const objectLockConfigurationProperty: s3.CfnBucket.ObjectLockConfigurationProperty = {
objectLockEnabled: 'objectLockEnabled',
rule: {
defaultRetention: {
days: 123,
mode: 'mode',
years: 123,
},
},
};
Properties
Name | Type | Description |
---|---|---|
object | string | Indicates whether this bucket has an Object Lock configuration enabled. |
rule? | IResolvable | Object | Specifies the Object Lock rule for the specified object. |
objectLockEnabled?
Type:
string
(optional)
Indicates whether this bucket has an Object Lock configuration enabled.
Enable ObjectLockEnabled
when you apply ObjectLockConfiguration
to a bucket.
rule?
Type:
IResolvable
|
Object
(optional)
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 .