Skip to content

S3  >  Structures  >  LifecycleRuleFilter

LifecycleRuleFilter

Structure Class

LifecycleRuleFilter dataclass

Bases: _SerdeShape

The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter can have exactly one of Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan, or And specified. If the Filter element is left empty, the Lifecycle Rule applies to all objects in the bucket.

Attributes

and_ class-attribute instance-attribute
and_: LifecycleRuleAndOperator | None = ...

This is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates. The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator.

object_size_greater_than class-attribute instance-attribute
object_size_greater_than: int | None = ...

Minimum object size to which the rule applies.

object_size_less_than class-attribute instance-attribute
object_size_less_than: int | None = ...

Maximum object size to which the rule applies.

prefix class-attribute instance-attribute
prefix: str | None = ...

Prefix identifying one or more objects to which the rule applies.

Warning

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.

tag class-attribute instance-attribute
tag: Tag | None = ...

This tag must exist in the object's tag set in order for the rule to apply.

Note

This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.