1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
2
Hello.
The S3 lifecycle rule will not delete the object exactly at the specified date and time, but rather the object will be added to the queue for deletion.
This means that there will be some delay before the deletion takes place because the deletion is done asynchronously.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-expire-general-considerations.html
Amazon S3 queues the object for removal and removes it asynchronously, permanently removing the object.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 7 Monaten
I understand that there might be a slight delay in deletion. The object was indeed deleted as scheduled. However, there was no applied rule displayed in the Management Configuration section of that object. It might mislead users. I'm not sure whether objects are applied with lifecycle rule.
Thank you for your reply. I have confirmed this in my environment. Perhaps what you can see from the object screen is only the lifecycle rules set in the current version of the action. The description of the "Expiration date" states "The object will be made noncurrent and generate a delete marker on this date.", so the Noncurrent version of the action is not relevant. Therefore, the "Noncurrent versions actions" rule cannot be checked from the S3 object.
Thanks a lot. I'll accept it as the answer. How can I use aws-sdk to check the remaining days before an object is deleted by a lifecycle rule? Or I have to handle this by myself?
By the way, I posted the same question on stackoverflow and I'd like to share your response with others there. Are you willing to post your answer on stackoverflow? I'll mark it as the accepted answer. If you don't use stackoverflow, could I forward your answer?
link: https://stackoverflow.com/questions/76880546/aws-s3-lifecycle-doesnt-apply-to-non-current-version-object
I don't think there is any way to check this one, even with the SDK. So I think the only way is to write and create your own program. For example, we could create a program that gets the last modified date of the object in head_object and subtracts it with the number of days set in the lifecycle rule. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/head_object.html
Yes, you are welcome to share.
I don't find any info about checking remaining days neither. I'll program it by myself. Thank you for your suggestion and generosity!!!