AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

A lifecycle rule for individual objects in an Amazon S3 bucket.

For more information see, Managing your storage lifecycle in the Amazon S3 User Guide.

Inheritance Hierarchy

System.Object
  Amazon.S3.Model.LifecycleRule

Namespace: Amazon.S3.Model
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z

Syntax

C#
public class LifecycleRule

The LifecycleRule type exposes the following members

Constructors

NameDescription
Public Method LifecycleRule()

Properties

NameTypeDescription
Public Property AbortIncompleteMultipartUpload Amazon.S3.Model.LifecycleRuleAbortIncompleteMultipartUpload

Gets and sets the property AbortIncompleteMultipartUpload.

Public Property Expiration Amazon.S3.Model.LifecycleRuleExpiration

Gets and sets the property Expiration.

Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker.

Public Property Filter Amazon.S3.Model.LifecycleFilter

Gets and sets the property Filter.

The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter must have exactly one of Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan, or And specified. Filter is required if the LifecycleRule does not contain a Prefix element.

For more information about Tag filters, see Adding filters to Lifecycle rules in the Amazon S3 User Guide.

Tag filters are not supported for directory buckets.

Public Property Id System.String

Gets and sets the property Id.

Unique identifier for the rule. The value cannot be longer than 255 characters.

Public Property NoncurrentVersionExpiration Amazon.S3.Model.LifecycleRuleNoncurrentVersionExpiration

Gets and sets the property NoncurrentVersionExpiration.

Public Property NoncurrentVersionTransitions System.Collections.Generic.List<Amazon.S3.Model.LifecycleRuleNoncurrentVersionTransition>

Gets and sets the property NoncurrentVersionTransitions.

Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to a specific storage class at a set period in the object's lifetime.

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

Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.

Public Property Prefix System.String

Gets and sets the property Prefix.

Prefix identifying one or more objects to which the rule applies. This is no longer used; use Filter instead.

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.

Public Property Status Amazon.S3.LifecycleRuleStatus

Gets and sets the property Status.

If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied.

Public Property Transitions System.Collections.Generic.List<Amazon.S3.Model.LifecycleTransition>

Gets and sets the property Transitions.

Specifies when an Amazon S3 object transitions to a specified storage class.

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

Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer