Show / Hide Table of Contents

Class CfnBucket.RuleProperty

Specifies lifecycle rules for an Amazon S3 bucket.

Inheritance
System.Object
CfnBucket.RuleProperty
Implements
CfnBucket.IRuleProperty
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.AWS.S3.dll
Syntax (csharp)
public class RuleProperty : Object, CfnBucket.IRuleProperty
Syntax (vb)
Public Class RuleProperty
    Inherits Object
    Implements CfnBucket.IRuleProperty
Remarks

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 .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;

RuleProperty ruleProperty = new RuleProperty {
    Status = "status",

    // the properties below are optional
    AbortIncompleteMultipartUpload = new AbortIncompleteMultipartUploadProperty {
        DaysAfterInitiation = 123
    },
    ExpirationDate = new Date(),
    ExpirationInDays = 123,
    ExpiredObjectDeleteMarker = false,
    Id = "id",
    NoncurrentVersionExpiration = new NoncurrentVersionExpirationProperty {
        NoncurrentDays = 123,

        // the properties below are optional
        NewerNoncurrentVersions = 123
    },
    NoncurrentVersionExpirationInDays = 123,
    NoncurrentVersionTransition = new NoncurrentVersionTransitionProperty {
        StorageClass = "storageClass",
        TransitionInDays = 123,

        // the properties below are optional
        NewerNoncurrentVersions = 123
    },
    NoncurrentVersionTransitions = new [] { new NoncurrentVersionTransitionProperty {
        StorageClass = "storageClass",
        TransitionInDays = 123,

        // the properties below are optional
        NewerNoncurrentVersions = 123
    } },
    ObjectSizeGreaterThan = 123,
    ObjectSizeLessThan = 123,
    Prefix = "prefix",
    TagFilters = new [] { new TagFilterProperty {
        Key = "key",
        Value = "value"
    } },
    Transition = new TransitionProperty {
        StorageClass = "storageClass",

        // the properties below are optional
        TransitionDate = new Date(),
        TransitionInDays = 123
    },
    Transitions = new [] { new TransitionProperty {
        StorageClass = "storageClass",

        // the properties below are optional
        TransitionDate = new Date(),
        TransitionInDays = 123
    } }
};

Synopsis

Constructors

RuleProperty()

Properties

AbortIncompleteMultipartUpload

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

ExpirationDate

Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.

ExpirationInDays

Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.

ExpiredObjectDeleteMarker

Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.

Id

Unique identifier for the rule.

NoncurrentVersionExpiration

Specifies when noncurrent object versions expire.

NoncurrentVersionExpirationInDays

(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

(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

For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.

ObjectSizeGreaterThan

Specifies the minimum object size in bytes for this rule to apply to.

ObjectSizeLessThan

Specifies the maximum object size in bytes for this rule to apply to.

Prefix

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

Status

If Enabled , the rule is currently being applied.

TagFilters

Tags to use to identify a subset of objects to which the lifecycle rule applies.

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

One or more transition rules that specify when an object transitions to a specified storage class.

Constructors

RuleProperty()

public RuleProperty()

Properties

AbortIncompleteMultipartUpload

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

public object AbortIncompleteMultipartUpload { get; set; }
Property Value

System.Object

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-abortincompletemultipartupload

ExpirationDate

Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier.

public object ExpirationDate { get; set; }
Property Value

System.Object

Remarks

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationdate

ExpirationInDays

Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier.

public Nullable<double> ExpirationInDays { get; set; }
Property Value

System.Nullable<System.Double>

Remarks

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationindays

ExpiredObjectDeleteMarker

Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions.

public object ExpiredObjectDeleteMarker { get; set; }
Property Value

System.Object

Remarks

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 .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-expiredobjectdeletemarker

Id

Unique identifier for the rule.

public string Id { get; set; }
Property Value

System.String

Remarks

The value can't be longer than 255 characters.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-id

NoncurrentVersionExpiration

Specifies when noncurrent object versions expire.

public object NoncurrentVersionExpiration { get; set; }
Property Value

System.Object

Remarks

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversionexpiration

NoncurrentVersionExpirationInDays

(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.

public Nullable<double> NoncurrentVersionExpirationInDays { get; set; }
Property Value

System.Nullable<System.Double>

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversionexpirationindays

NoncurrentVersionTransition

(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.

public object NoncurrentVersionTransition { get; set; }
Property Value

System.Object

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition

NoncurrentVersionTransitions

For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class.

public object NoncurrentVersionTransitions { get; set; }
Property Value

System.Object

Remarks

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransitions

ObjectSizeGreaterThan

Specifies the minimum object size in bytes for this rule to apply to.

public Nullable<double> ObjectSizeGreaterThan { get; set; }
Property Value

System.Nullable<System.Double>

Remarks

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 .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-objectsizegreaterthan

ObjectSizeLessThan

Specifies the maximum object size in bytes for this rule to apply to.

public Nullable<double> ObjectSizeLessThan { get; set; }
Property Value

System.Nullable<System.Double>

Remarks

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 .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-objectsizelessthan

Prefix

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

public string Prefix { get; set; }
Property Value

System.String

Remarks

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 .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-prefix

Status

If Enabled , the rule is currently being applied.

public string Status { get; set; }
Property Value

System.String

Remarks

If Disabled , the rule is not currently being applied.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-status

TagFilters

Tags to use to identify a subset of objects to which the lifecycle rule applies.

public object TagFilters { get; set; }
Property Value

System.Object

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-tagfilters

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.

public object Transition { get; set; }
Property Value

System.Object

Remarks

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transition

Transitions

One or more transition rules that specify when an object transitions to a specified storage class.

public object Transitions { get; set; }
Property Value

System.Object

Remarks

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transitions

Implements

CfnBucket.IRuleProperty
Back to top Generated by DocFX