• Object Storage Service

  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Buckets
  5. PUT Bucket lifecycle

PUT Bucket lifecycle

OBS supports periodic transition and deletion of objects in a bucket based on a specified rule. This is implemented in lifecycle configuration. After the bucket lifecycle is set, OBS automatically deletes objects at the time specified in this operation. This operation can be used to delete:

  • Periodically uploaded files: Some periodically uploaded files need to be retained for only one week or one month.
  • Documents that are seldom accessed after a certain period of time. These documents may be archived for another period of time and be deleted then.
  • The minimum time for the transition of the bucket storage to Warm or to Cold can be configured. The value ranges from 24 to 8640.

This operation is used to create or update the lifecycle configuration of a bucket.

Only users granted the s3:PutLifecycleConfiguration permission can create or update the bucket lifecycle configuration. By default, only the bucket owner can set the bucket lifecycle configuration. The bucket owner can allow other users to set the bucket lifecycle configuration by granting them the permission.

The lifecycle configuration supports periodic deletion and transition of objects. If you want to prevent a user from deleting and transitioning objects, disable the following permissions:

  • s3:DeleteObject
  • s3:DeleteObjectVersion
  • s3:PutLifecycleConfiguration

If you want to prevent a user configuring a bucket lifecycle, revoke the s3:PutLifecycleConfiguration permission from the user.