1

Versioning is not suitable in my case because if the user wants to delete anything in storage it would be deleted permanently not soft-deleted but for the backup purpose, I have to use Cross-Region Replication and to use CRR I need to enable Versioning.

I tried to delete those object which has Delete-marker as the current version and non-current version as a soft deleted object. here is my life cycle rule policy. No Transitions, No current version expiration.

Only applied the Previous version permanently delete so that it considers delete marker as the current version and soft-deleted object as the previous version and delete it permanently BUT I DON'T KNOW IT IS NOT WORKING...!

I checked on next day the deleted version is still there also I have added multiple version of the same object and that versions are also not deleted.

Chris Williams
  • 32,215
  • 4
  • 30
  • 68
ajay makwana
  • 79
  • 1
  • 7
  • did you ever resolve this; I have the exact same problem :(, and the exact same test scenario as you describe in your comments on the answer – Brondahl Jan 20 '23 at 07:53

1 Answers1

1

If you have only just enabled it, it might still be queuing objects that need to be deleted.

Lifecycle policies do not delete exactly after this marker, in fact actions are queued and processed later on.

When an object reaches the end of its lifetime, Amazon S3 queues it for removal and removes it asynchronously. There might be a delay between the expiration date and the date at which Amazon S3 removes an object. You are not charged for storage time associated with an object that has expired.

Sometimes when you first configure it can be slightly delayed (because it has not queued anything) so I would suggest checking back in a couple of days when this process should now have happened.

More information is available in the Understanding object expiration documentation.

Chris Williams
  • 32,215
  • 4
  • 30
  • 68
  • I have applied it 2days ago...and it has only 2 delete marked. dose it takes that much of time to be queued ??? – ajay makwana Jul 23 '20 at 07:26
  • Have you added any specific prefix? It can take a couple of days but I would not expect longer than that – Chris Williams Jul 23 '20 at 07:30
  • No, I have applied rule for an entire bucket, not for prefix/teg. and somewhere in [this doc](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html) I have read something like this **Amazon S3 doesn't take any action if there are one or more object versions and the delete marker is the current version.** what does it mean? It will not delete deleted object am I right? – ajay makwana Jul 23 '20 at 08:37
  • @ajaymakwana What I understand from this statement is that when an expiration lifecycle policy is set for objects that have versions but the latest version is a delete marker, Amazon S3 takes no actions for these objects. Note that this statement is written under the expiration action. – Talha Ashraf Apr 14 '22 at 09:42
  • @ChrisWilliams do you have any other theories for why this might not be working in the way it appears to be supposed to work? I have exactly the same scenario; I created a "Delete Noncurrent Versions, and Expired Delete Markers after 1 day" rule ... 2 days ago ... on a test bucket with ~10 objects total, and they're all still there :( – Brondahl Jan 20 '23 at 07:55