You can use the lifecycle management feature when you need to change the storage class or delete specified objects regularly to reduce costs. COS will automatically change the storage class or delete specified objects within the specified time frame according to the rules you set. For more information, see Lifecycle Overview.
A lifecycle can be set to as long as 3,650 days.
- Log in to the COS Console.
- On the left sidebar, click Bucket List to enter the bucket list page.
- Locate the bucket for which you want to enable the lifecycle feature. Click the bucket name to enter its details page.
- Click Advanced Configuration on the left, scroll down to Lifecycle, and then click Add a Rule.
- Add lifecycle rules as needed. The configuration items are described as follows:
- Rule ID: enter a name for the lifecycle rule.
- Applied to: this lifecycle rule can be applied to the entire bucket or just objects with a specific prefix, such as
example. If you select Prefix name, you need to enter a prefix.
- Prefix: For information on object keys (or prefixes), see ObjectKey in Object Overview. For lifecycle configuration rules, see Rule Description.
- Managing the current version: you can transition or delete the current version of an object using this option. It allows you to transition objects in your bucket from COS STANDARD to COS STANDARD_IA or ARCHIVE, or delete objects upon expiration.
COS storage classes are STANDARD, STANDARD_IA, and ARCHIVE in order from hot to cold storage. You can transition objects only from a hot storage class to a colder one, not vice versa. Time is measured for a file starting from the moment it is modified (i.e., re-uploaded) in COS.
- Managing historical versions: you can transition or delete previous versions of an object using this option. If it is not enabled, only the latest version of an object is processed by default.
- Removing delete markers with no noncurrent versions: if an object has a delete marker as its latest version, with all of its noncurrent versions deleted, the delete marker will also be deleted once you enable this option. It cannot be enabled with the option to delete upon expiration under Managing the current version at the same time.
- Deleting incomplete multipart uploads: allows you to delete expired incomplete multipart uploads that have failed due to any reason.
- After the lifecycle rule is configured, click OK, and it will be listed instantly.
- When you want to disable a lifecycle rule, click Edit to change the rule state to Off, or simply delete the rule.