interface RuleProperty
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.S3.CfnBucket.RuleProperty |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucket_RuleProperty |
![]() | software.amazon.awscdk.services.s3.CfnBucket.RuleProperty |
![]() | aws_cdk.aws_s3.CfnBucket.RuleProperty |
![]() | aws-cdk-lib » aws_s3 » CfnBucket » RuleProperty |
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
.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-rule.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
const ruleProperty: s3.CfnBucket.RuleProperty = {
status: 'status',
// the properties below are optional
abortIncompleteMultipartUpload: {
daysAfterInitiation: 123,
},
expirationDate: new Date(),
expirationInDays: 123,
expiredObjectDeleteMarker: false,
id: 'id',
noncurrentVersionExpiration: {
noncurrentDays: 123,
// the properties below are optional
newerNoncurrentVersions: 123,
},
noncurrentVersionExpirationInDays: 123,
noncurrentVersionTransition: {
storageClass: 'storageClass',
transitionInDays: 123,
// the properties below are optional
newerNoncurrentVersions: 123,
},
noncurrentVersionTransitions: [{
storageClass: 'storageClass',
transitionInDays: 123,
// the properties below are optional
newerNoncurrentVersions: 123,
}],
objectSizeGreaterThan: 123,
objectSizeLessThan: 123,
prefix: 'prefix',
tagFilters: [{
key: 'key',
value: 'value',
}],
transition: {
storageClass: 'storageClass',
// the properties below are optional
transitionDate: new Date(),
transitionInDays: 123,
},
transitions: [{
storageClass: 'storageClass',
// the properties below are optional
transitionDate: new Date(),
transitionInDays: 123,
}],
};
Properties
Name | Type | Description |
---|---|---|
status | string | If Enabled , the rule is currently being applied. |
abort | IResolvable | Abort | Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket. |
expiration | date | IResolvable | Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. |
expiration | number | Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier. |
expired | boolean | IResolvable | Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions. |
id? | string | Unique identifier for the rule. |
noncurrent | IResolvable | Noncurrent | Specifies when noncurrent object versions expire. |
noncurrent | number | (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 | IResolvable | Noncurrent | (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 | IResolvable | IResolvable | Noncurrent [] | 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 | number | Specifies the minimum object size in bytes for this rule to apply to. |
object | number | Specifies the maximum object size in bytes for this rule to apply to. |
prefix? | string | Object key prefix that identifies one or more objects to which this rule applies. |
tag | IResolvable | IResolvable | Tag [] | Tags to use to identify a subset of objects to which the lifecycle rule applies. |
transition? | IResolvable | Transition | (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? | IResolvable | IResolvable | Transition [] | One or more transition rules that specify when an object transitions to a specified storage class. |
status
Type:
string
If Enabled
, the rule is currently being applied.
If Disabled
, the rule is not currently being applied.
abortIncompleteMultipartUpload?
Type:
IResolvable
|
Abort
(optional)
Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.
expirationDate?
Type:
date |
IResolvable
(optional)
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.
expirationInDays?
Type:
number
(optional)
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.
expiredObjectDeleteMarker?
Type:
boolean |
IResolvable
(optional)
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
.
id?
Type:
string
(optional)
Unique identifier for the rule.
The value can't be longer than 255 characters.
noncurrentVersionExpiration?
Type:
IResolvable
|
Noncurrent
(optional)
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.
noncurrentVersionExpirationInDays?
Type:
number
(optional)
(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.
noncurrentVersionTransition?
Type:
IResolvable
|
Noncurrent
(optional)
(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.
noncurrentVersionTransitions?
Type:
IResolvable
|
IResolvable
|
Noncurrent
[]
(optional)
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.
objectSizeGreaterThan?
Type:
number
(optional)
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 .
objectSizeLessThan?
Type:
number
(optional)
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 .
prefix?
Type:
string
(optional)
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 .
tagFilters?
Type:
IResolvable
|
IResolvable
|
Tag
[]
(optional)
Tags to use to identify a subset of objects to which the lifecycle rule applies.
transition?
Type:
IResolvable
|
Transition
(optional)
(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?
Type:
IResolvable
|
IResolvable
|
Transition
[]
(optional)
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.