On the LifeCycle Rules tab of the Element Store page, click Create Lifecycle Rule.
Enter rule name in the Rule name field and the name of a view in the View field. Every rule applies within a specified view.
If you do not want the rule to apply to all objects in the view, define a scope of objects in the Rule scope section. The rule will only apply to objects in the defined scope. You can restrict the scope by either or both of the following:
Object prefix. This defines a prefix common to all objects that you want to include. Enter that prefix in the Prefix filter field.
In S3 terms, this is a prefix that may be common to multiple object keys (names). Specifying a prefix defines a scope of objects to which the rule applies. For example, if you specify sales/jan, all objects in the view that have object keys that begin with sales/jan will fall into the scope.
In terms of file and directory nomenclature, a prefix is a file and/or directory path within the view that can include part of the file or directory name. It can be common to multiple items in order to catch them all within the scope.
For example, if you want to specify all files under a directory called sales that resides under the view, you can enter sales/. This prefix will exclude the directory itself from the scope. If you were to enter sales that would include the directory as well as all the files under the directory. If you were to enter sales/j that would include all files under the directory with names that begin with 'j'.
Object size. To limit the scope by size of object, enter a minimum and/or a maximum size in the fields provided. You can select the size units from the dropdowns provided.
Use the remaining fields to define object expiration conditions:
Days after object creation
Enter a number of days after objects are created that you want them to expire. When the rule is created and enabled, all objects that match the defined scope will be expired when they are this number of days old.
In a non versioned bucket view, expiration means that the object is permanently removed.
In a versioned bucket view, where the objects are versioned:
If the current version is not a delete marker, a delete marker is created and that becomes the current version. The existing current version is retained as a non current version. When the delete marker reaches this same number of days, it is deleted.
If there are one or more object versions and the delete marker is the current version, no action is taken.
If the current object version is the only object version and it is also a delete marker, it is removed. That is, all object versions were deleted and there is only a delete marker remaining. This is called an expired object delete marker and it is removed.
Delete expired object delete markers
Check this box to delete expired object delete markers as soon as they become expired object delete markers. An expired object delete marker is an object version that is the only version of an object and is also a delete marker.
This checkbox is mutually exclusive with Days after object creation, which deletes expired object delete markers when they satisfy the specified age criteria. If you want to expire objects using Days after object creation and also clean up expired object delete markers as soon as they are created as such, create two separate rules.
Days after the start of upload
Use this field to remove incomplete multipart uploads, which are not removed through Days after object creation. Specify the number of days after multipart uploads are started when they should be aborted and removed if they are incomplete.
Days from becoming a Previous version
Relevant only for versioned buckets. If set, noncurrent versions of objects are deleted after the set number of days, provided they are not the newest noncurrent versions up to the number set to be retained, if that number is set as Number of versions to retain.
Number of versions
Relevant only for versioned buckets. Use this field to specify a number of noncurrent versions of objects to retain. The newest non current versions up to this number will not expire even if they exceed Days from becoming a Previous version.
Decide whether you want this rule to be enabled immediately after you create it. If enabled, the rule will be effective immediately on all objects that currently meet the scope and age criteria that you defined for object expiration.
If preferred, slide the Enabled slider to the off position to create the rule without activating it immediately.
The rule is created and its properties appear in the LifeCycle Rules tab of the Element Store page.
To create a lifecycle rule, use the lifecyclerule create command.
Article is closed for comments.