Hello,
I understand you have a question about S3 lifecycle policies.
According to the S3 Lifecycle Policy documentation on AWS Docs [1], you can use Expiration actions. These actions define when objects expire. Amazon S3 deletes expired objects on your behalf asynchronously. With S3 Lifecycle configuration rules, you can tell Amazon S3 to transition objects to less-expensive storage classes, or archive or delete them. However, this alone does not solve your problem since, as you said, policies only allow you to delete objects from its creation date.
Per rePost-User-2738569, this is where versioning comes in. If you set a lifecycle policy with bucket versioning enabled, every time a user changes an object, the object gets a new "version id". This becomes the newest version of the object and the main one that the user will see. You can set the number of days for when a object becomes noncurrent, and the number of newer versions to retain. That way, even though a number of objects are noncurrent, only the number of objects you specify will be retained.
Thus, you can set the number of days for expiration to be 90. You can set final deletion for 90 days this way as well.
But the file will never be versioned, it's uploaded and then deleted but nothing happens between this two events. If versioning is enabled i will always have one version (current version) so if delete the file the problem remain the same ?
How about i add a to_delete
tag and a to_delete
metadata when the user wants to deletes the file. If my understanding is correct, if a file metadata is added aws creates a copy of the file which would resolves the problem of the creation date ?
Relevant questions
S3 Object lock in compliance mode, file uploaded thru cli, file properties shows compliance mode, I can still delete it.
Accepted Answerasked 8 months agoUsing S3 bucket as a file server for the public
asked 2 months agoHow to use s3 life cycle policy for multiple buckets those starting with some fixed naming ?
asked a month agoDoes the AmazonS3 class from the AWS JavaSDK use the public internet to upload a file to an s3 bucket?
Accepted Answerasked 7 months agoHow can i import an .xlsx File located in S3 Bucket in my quicksight?
asked 6 months agoHow can I use AWS Glue to split a file by number of lines?
Accepted Answerasked 21 days agoAWS s3 sync Fails with Extant File (debug log is attached)
asked 2 years agoAWS S3: Delete a file x days after last modification
asked 13 days agoHow to save a file to a tmp/temp folder in lambda?
asked 4 months agoWhy is my AWS S3 Usage So High?
asked 8 months ago
Have you enabled versioning? And is the modified object name going to remain the same?
No bucket versioning is not enabled and yes the modified object will still have the same name