LifecycleRule

class aws_cdk.aws_s3.LifecycleRule(*, abort_incomplete_multipart_upload_after=None, enabled=None, expiration=None, expiration_date=None, id=None, noncurrent_version_expiration=None, noncurrent_version_transitions=None, prefix=None, tag_filters=None, transitions=None)

Bases: object

__init__(*, abort_incomplete_multipart_upload_after=None, enabled=None, expiration=None, expiration_date=None, id=None, noncurrent_version_expiration=None, noncurrent_version_transitions=None, prefix=None, tag_filters=None, transitions=None)

Declaration of a Life cycle rule.

Parameters
  • abort_incomplete_multipart_upload_after (Optional[Duration]) – Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket. The AbortIncompleteMultipartUpload property type creates a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket. When Amazon S3 aborts a multipart upload, it deletes all parts associated with the multipart upload. Default: Incomplete uploads are never aborted

  • enabled (Optional[bool]) – Whether this rule is enabled. Default: true

  • expiration (Optional[Duration]) – Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon 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. Default: No expiration timeout

  • expiration_date (Optional[datetime]) – Indicates when objects are deleted from Amazon S3 and Amazon 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. Default: No expiration date

  • id (Optional[str]) – A unique identifier for this rule. The value cannot be more than 255 characters.

  • noncurrent_version_expiration (Optional[Duration]) – Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire. 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. Default: No noncurrent version expiration

  • noncurrent_version_transitions (Optional[List[NoncurrentVersionTransition]]) – One or more transition rules that specify when non-current objects transition to a specified storage class. Only for for buckets with versioning enabled (or suspended). If you specify a transition and expiration time, the expiration time must be later than the transition time.

  • prefix (Optional[str]) – Object key prefix that identifies one or more objects to which this rule applies. Default: Rule applies to all objects

  • tag_filters (Optional[Mapping[str, Any]]) – The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket. Default: Rule applies to all objects

  • transitions (Optional[List[Transition]]) – 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. Default: No transition rules

Return type

None

Attributes

abort_incomplete_multipart_upload_after

Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket.

The AbortIncompleteMultipartUpload property type creates a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket. When Amazon S3 aborts a multipart upload, it deletes all parts associated with the multipart upload.

default :default: Incomplete uploads are never aborted

Return type

Optional[Duration]

enabled

Whether this rule is enabled.

default :default: true

Return type

Optional[bool]

expiration

Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon 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.

default :default: No expiration timeout

Return type

Optional[Duration]

expiration_date

Indicates when objects are deleted from Amazon S3 and Amazon 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.

default :default: No expiration date

Return type

Optional[datetime]

id

A unique identifier for this rule.

The value cannot be more than 255 characters.

Return type

Optional[str]

noncurrent_version_expiration

Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire.

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.

default :default: No noncurrent version expiration

Return type

Optional[Duration]

noncurrent_version_transitions

One or more transition rules that specify when non-current objects transition to a specified storage class.

Only for for buckets with versioning enabled (or suspended).

If you specify a transition and expiration time, the expiration time must be later than the transition time.

Return type

Optional[List[NoncurrentVersionTransition]]

prefix

Object key prefix that identifies one or more objects to which this rule applies.

default :default: Rule applies to all objects

Return type

Optional[str]

tag_filters

The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.

default :default: Rule applies to all objects

Return type

Optional[Mapping[str, Any]]

transitions

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.

default :default: No transition rules

Return type

Optional[List[Transition]]