Amazon S3 Bucket Lifecycle Configuration: Object Expiration and Storage Class Transitions
CS Browser
Free Windows client for Amazon S3 and Amazon S3 compatible storage services
 
Follow

Amazon S3 Bucket Lifecycle Configuration

Amazon S3 Lifecycle Rules Overview

Amazon S3 Lifecycle rules automate storage-class transitions and file cleanup. A rule can apply to every file in a bucket or to files selected by prefix and object tags.

Lifecycle rules can perform the following actions:

  • Transition files to supported lower-cost storage classes:
  • Expiration defines when files expire. The result depends on whether bucket versioning is enabled.
  • Abort incomplete multipart uploads removes uploads that were not completed within the specified period.
  • Remove expired object delete markers cleans up delete markers that no longer have any associated file versions.

Each lifecycle rule contains:

  • Filter - identifies the files to which the rule applies. You can filter files by prefix, one or more object tags, or both.
  • Actions and conditions - define what Amazon S3 should do and when. A rule can contain separate actions for current and noncurrent file versions, as well as other cleanup actions.

How to add a lifecycle rule

  1. Select the bucket you want to configure, then choose Buckets -> Lifecycle Configuration.. or press Ctrl+I.

    Buckets menu with Lifecycle Configuration selected
    Open Buckets -> Lifecycle Configuration..

    The Bucket Lifecycle Rules dialog will open:

    Bucket Lifecycle Rules dialog with Add selected
    Bucket Lifecycle Rules dialog. Click Add or press Insert.
  2. Click Add.

    The Add New Lifecycle Rule dialog contains four tabs:

    • Filter - the page where you define the filter. The filter identifies one or more files to which the rule applies.
    • Actions for current versions - the page where you define transition and expiration actions for current file versions.
    • Actions for noncurrent versions - the page where you define transition and expiration actions for noncurrent file versions.
    • Other actions - the page where you configure other actions such as aborting incomplete multipart uploads and removing expired object delete markers.
  3. Specify the rule details:

    Filter

    The Filter tab of the Add New Lifecycle Rule Dialog
    Add New Lifecycle Rule dialog - the Filter tab

    You can apply the rule to all files or define a filter based on a prefix, one or more object tags, or both.

    Prefix - identifies files whose keys begin with the specified value, for example logs/. An empty prefix means all files.

    Tags - limits the rule to files with the specified object tags.

    If you specify multiple tags, the rule applies only to files that have all of them. Amazon S3 combines the tags using a logical AND.

    If you specify both a prefix and tags, a file must match the prefix and all specified tags. A filter can contain one prefix and zero or more tags.

    Actions for current/noncurrent versions

    Add New Lifecycle Rule - Transition/Expiration actions
    Add New Lifecycle Rule dialog - Actions for current versions

    Transitions move files from one storage class to another when they reach the specified age or date. The available destination classes depend on the current storage class. See Supported transitions and related constraints in the AWS documentation.

    Supported transitions are displayed on a diagram below:

    Supported Transitions via Lifecycle Rules
    Supported transitions via Bucket Lifecycle Rules. Image from the AWS documentation.

    Expiration makes matching files expire after a specified number of days or on a particular date. For a bucket without versioning, expiration permanently deletes the file. For a versioned bucket, expiration normally creates a delete marker for the current version.

    See the AWS documentation for details about lifecycle actions and how Amazon S3 calculates file age.

    Important: The date-based action is not a one-time action. S3 continues to apply the date-based action even after the date has passed, as long as the rule status is Enabled.

    Other actions

    Add New Lifecycle Rule - Other actions
    Add New Lifecycle Rule dialog - Other actions

    Abort uploads that are not successfully completed sets the maximum number of days that a multipart upload may remain in progress.

    If a matching multipart upload is not completed within this period, Amazon S3 aborts it and removes the uploaded parts.

    Remove expired object delete markers is available only for versioned buckets.

    An expired object delete marker is a delete marker for which no file versions remain. This action directs Amazon S3 to remove such markers.

    Neither action can be used in a lifecycle rule that has a tag-based filter.

  4. Click Add new rule

    Add New Lifecycle Rule
    Click Save or press Ctrl+S to submit the lifecycle configuration to Amazon S3.
  5. Click Save to submit your changes to Amazon S3.

How to edit a lifecycle rule

  1. Select the bucket whose lifecycle configuration you want to edit, then choose Buckets -> Lifecycle Configuration.. or press Ctrl+I.

    Buckets menu with Lifecycle Configuration selected
    Open Buckets -> Lifecycle Configuration..

    The Bucket Lifecycle Rules dialog will open:

    Bucket Lifecycle Rules
    Select the rule and click Edit or press F2.
  2. Select the rule and click Edit.

    The Edit Lifecycle Rule dialog will open:

    Edit Lifecycle Rule dialog
    Edit Lifecycle Rule properties and click Save changes
  3. Edit the rule properties and click Save changes.

  4. Click Save to submit the updated lifecycle configuration to Amazon S3.

How to delete lifecycle rules

  1. Select the bucket whose lifecycle configuration you want to update, then choose Buckets -> Lifecycle Configuration.. or press Ctrl+I.

    Buckets menu with Lifecycle Configuration selected
    Open Buckets -> Lifecycle Configuration..

    The Bucket Lifecycle Rules dialog will open:

    Bucket Lifecycle Rules
    Select the rules you want to delete and click Delete or press Delete.
  2. Select one or more rules and click Delete.

  3. Click Save to submit the updated lifecycle configuration to Amazon S3.

Lifecycle rules for versioned buckets

For a versioned bucket, you can configure separate transition and expiration actions for current and noncurrent file versions.

Use the Actions for current versions and Actions for noncurrent versions tabs to configure these actions. The Other actions tab also provides cleanup options for expired object delete markers and incomplete multipart uploads.

Bucket Lifecycle Rules dialog for a versioned bucket:

Lifecycle Rules for Versioning-enabled buckets
Lifecycle rules for a versioned bucket

Edit Lifecycle Rule dialog for a versioned bucket:

Edit Lifecycle Rule dialog for Versioning-enabled buckets
Configure actions for noncurrent file versions

See also: How to restore versions stored in the GLACIER or DEEP_ARCHIVE storage classes.

CS Browser 13.5.5 Freeware
Powered by Amazon Web Services and Rated by CNET Editors!
Social Connection
 
People like CS Browser!
People like us
Our customers say

"CS Browser is an invaluable tool to me as a web developer to easily manage my automated site backups" -Bob Kraft, Web Developer

"Just want to show my appreciation for a wonderful product. I use CS Browser a lot, it is a great tool." -Gideon Kuijten, Pro User

"Thank You Thank You Thank You for this tool. A must have for anyone using Amazon S3!" -Brian Cummiskey, USA

Related Products
RdpGuard
protects your Windows Server from RDP Brute-force Attacks.
CS Browser is developed by Netsdk Software FZE and is not affiliated with, endorsed by, or sponsored by Amazon or AWS. Amazon S3 and Amazon S3 Glacier are trademarks of Amazon.com, Inc. or its affiliates.
Copyright © 2008-2026 Netsdk Software FZE. All rights reserved.  Terms of Use.  Privacy Policy.  Mount Amazon S3 Bucket.  RDP brute-force protection.