Home > Software engineering >  S3 Versioning and Lifecycle rules - Will "Expire current versions of objects" also delete
S3 Versioning and Lifecycle rules - Will "Expire current versions of objects" also delete

Time:01-07

I am having trouble understanding the relationship between Delete markers and Lifecycle rules in S3 with versioning.

Here is my lifecycle rule:

enter image description here

enter image description here

Does this mean that the Expire current versions of objects option would delete a delete marker after it becomes the "current" version? AKA 180 days after the actual current version is deleted?

From what I understand this would mean:

  • After 180 days the current version of example.txt would expire, a delete marker is created for it and the current version becomes a noncurrent version attached to the delete marker

  • Another 180 days later, the noncurrent example.txt would be permanently deleted and the "current" version (the delete marker) would "expire", and since it is a delete marker that means it would be permanently deleted as well

Is this an accurate understanding or do I need to make an additional lifecycle rule that deletes expired delete markers?

Thank you!

CodePudding user response:

Yes you are correct

  • Delete marker on current version makes it non current version
  • After another 180 days, since you are deleting non current version it will Alsop delete delete markers of non current version too.

An expired object delete marker is removed if all noncurrent versions of an object expire after deleting a versioned object.

That is why you cannot expire current version and delete expire object markers together.

Refer Removing expired object delete markers , and understanding delete markers for more detail

  • Related