Managing lifecycles of object in buckets
Object Storage lets you manage lifecycles for objects in buckets.
Management console
AWS CLI
- In the management console, go to the bucket you want to configure object lifecycles for.
- In the left pane, select Lifecycle.
- Click Configure.
- On the page that opens, you can add, remove, and edit configuration rules. For a detailed description of the configuration fields, see Bucket object lifecycle configuration.
Note
In the management console, you can't use a single rule to set the criteria for deleting objects or changing the object storage class. Use a separate rule for each type of criteria.
To upload a configuration via the AWS CLI:
-
Define the object lifecycle configuration in JSON format. For example:
{ "Rules": [ { "ID": "DeleteOldBackups", "Filter": { "Prefix": "backup/" }, "Status": "Enabled", "Expiration": { "Days": 180 } } ] }
When you're done, you can save your configuration as a file, like
lifecycles.json
. -
Upload the configuration to a bucket, like
backup-bucket
:aws s3api put-bucket-lifecycle-configuration \ --bucket backup-bucket \ --lifecycle-configuration file://lifecycles.json \ --endpoint-url=https://storage.yandexcloud.net