1 Answer
- Newest
- Most votes
- Most comments
2
"pending deletion" state for 30 days before being deleted is not possible
But what you can do is to enable S3 versioning
Versioning-enabled buckets can help you recover objects from accidental deletion or overwrite. For example, if you delete an object, Amazon S3 inserts a delete marker instead of removing the object permanently.
With versioning you can recover more easily from both unintended user actions and application failures.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/Versioning.html
Relevant content
asked 3 years ago
asked 3 years ago
asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago

Thank you - that looks promising, yes.
So I think I could "DELETE" the item, to mark it for deletion and then use NoncurrentVersionExpiration to delete non-current versions after 30 days? And the docs talk about using "DELETE Object versionId" to hard delete the object, but presumably I can ban that in policy so that the soft delete is the only option allowed?
Yes, Paul, you're exactly right on both counts. The permission for which to set a "Deny" statement in the policy to block "hard deletes" by users is
s3:DeleteObjectVersion. The "soft-delete" action (when, and only when, versioning is enabled for the bucket) iss3:DeleteObject.Thank you, Oleksii and Leo. I suspect I would have struggled to spot that.