How do I create Amazon S3 lifecycle configuration rules for noncurrent object versions?

4 minute read
0

I want to create Amazon Simple Storage Service (Amazon S3) lifecycle configuration rules for noncurrent object versions.

Resolution

Lifecycle rule for transitioning noncurrent objects

To transition noncurrent versions, Amazon S3 uses the NoncurrentVersionTransition action. Use this action to specify when Amazon S3 must transition objects to the specified storage class.

Follow these steps to create a lifecycle rule for transitioning noncurrent object versions:

  1. Open the Amazon S3 console.
  2. In the list of buckets, choose the bucket that you want to create the lifecycle rule for.
  3. Choose the Management tab, and then choose Create lifecycle rule.
  4. For Lifecycle rule name, enter a name for your rule.
  5. For Choose a rule scope:
    To apply this lifecycle rule for a particular prefix, select Limit the scope of this rule using one or more filters.
    To apply the lifecycle rule for the whole bucket, select Apply to all objects in the bucket.
  6. If you selected Limit the scope of this rule using one or more filters, then enter the prefix name.
    If you selected Apply to all objects in the bucket, then select I acknowledge that this rule will apply to all objects in the bucket.
  7. Under Lifecycle rule actions, select Move noncurrent versions of objects between storage classes to create a lifecycle rule.
  8. In the Transition noncurrent versions of objects between storage classes field:
    For Choose storage class transitions, choose the desired storage class.
    For Days after objects become noncurrent, enter the number of days that the object can be noncurrent before S3 transitions the object version.
    For Number of newer versions to retain, select the number of versions that you want to retain in the storage class.
  9. Choose Create rule.

If the rule doesn't contain any errors, Amazon S3 turns it on. You can see the rule on the Management tab under Lifecycle rules.

Lifecycle rule for expiration of noncurrent objects

To delete noncurrent versions, Amazon S3 uses the NoncurrentVersionExpiration action. Use this action to specify when Amazon S3 must permanently delete noncurrent versions of objects. These deleted objects can't be recovered.

Follow these steps to create a lifecycle rule for expiration of noncurrent object versions:

  1. Open the Amazon S3 console.
  2. In the list of buckets, choose the bucket that you want to create the lifecycle rule for.
  3. Choose the Management tab, and then choose Create lifecycle rule.
  4. For Lifecycle rule name, enter a name for your rule.
  5. For Choose a rule scope:
    To apply this lifecycle rule for a particular prefix, select Limit the scope of this rule using one or more filters.
    To apply the lifecycle rule for the whole bucket, select Apply to all objects in the bucket.
  6. If you selected Limit the scope of this rule using one or more filters, enter the prefix name.
    If you selected Apply to all objects in the bucket, select I acknowledge that this rule will apply to all objects in the bucket.
  7. Under Lifecycle rule actions, select to create a lifecycle rule.
  8. In the Permanently delete noncurrent versions of objects field:
    For Days after objects become noncurrent, enter the number of days that the object can be noncurrent before S3 permanently deletes them.
    For Number of newer versions to retain, select the number of versions that you want to retain in the storage class.
  9. Choose Create rule.

If the rule doesn't contain any errors, Amazon S3 turns it on. You can see the rule on the Management tab under Lifecycle rules.

AWS OFFICIAL
AWS OFFICIALUpdated 9 months ago