'Is it possible to mark an S3 object to be automatically deleted in the future?

I'm processing many S3 Documents, and I'd like to mark them for deletion once they have been deleted, but in the future (one hour from now). This is because once they have been processed, they need to remain available for a while before being deleted.

I saw about the lifecycle system for the bucket, but this is a per S3 object basis as it depends on when they have been processed.

I saw that Boto3 provide the "Expires" metadata, but the description mention the object not being cacheable, so I'm not sure it would mean deleting it.

Is there an effective way to update a S3 object to be removed at a certain date? (or in a specific amount of seconds from now)

Thank you in advance



Solution 1:[1]

You can turn on the bucket versioning and when you delete the object, it wlll not deleted but add the deletion marker. You can also set the lifecycle policy for the deletion marker to keep how ling that object. See Documentations

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lamanus