skip to Main Content

I created an S3 bucket with versioning enabled and later realized that I don’t need to keep multiple versions. I suspended versioning but when I delete a file, and click on show versions, it is showing Delete marker under "Type" and Version ID: null and Size 0 Bytes.

So I don’t understand what’s the point of suspending the versioning.

2

Answers


  1. From Deleting objects from versioning-suspended buckets – Amazon Simple Storage Service:

    You can delete objects from versioning-suspended buckets to remove an object with a null version ID.

    If versioning is suspended for a bucket, a DELETE request:

    • Can only remove an object whose version ID is null.
    • Doesn’t remove anything if there isn’t a null version of the object in the bucket.
    • Inserts a delete marker into the bucket.

    I suspect this is because deleting an object does not automatically delete all of the prior versions. Instead, it only deletes the "current" object. However, if the "current object" is a version (that is, there are previous versions of the object), it will still use a Delete Marker to simply hide the current version.

    If you wish to delete the whole object (including previous versions), you will need to turn on "Show versions" and delete all of the previous versions.

    Login or Signup to reply.
  2. Response from John is correct. Another option would be to enable a lifecycle rule on the bucket that deletes versions.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search