- Mais recentes
- Mais votos
- Mais comentários
S3 lifecycle rule will work on the non-current objects that have the "version-id=null" and will expire the objects as per the rule you have configured. For non-current objects, it is important to note that the object becomes non-current on the day when the new version of object is created. S3 lifecycle is evaluated everyday at UTC midnight. Additionally, Amazon S3 also rounds the expiration date of an object to midnight UTC the next day.
Considering below example:
If you have a lifecycle rule to delete the non-current object versions after 1 day of being non-current and you uploaded an object (version ID: abc) on 1/1/2020 at 10:30 UTC and the new version of same object (version ID: xyz) was created the next day on 2/1/2020 at 11:30 UTC, the object version having version ID: abc became non-current on 2/1/2020 at 11:30 UTC. As per the rule, this non-current object version (version ID: abc) was eligible for deletion after 1 day of being non-current (which is 2/1/2020 at 11:30 UTC + 1 day). As lifecycle rule rounds off the expiration date to nearest UTC, hence, this non-current version would have been marked for deletion on 4/1/2020 at 00:00 UTC.
For below queries:
- Is this expecting behaviour that lifecycle rules cannot work on non-current object that having null version-id? Is there a way we leverage the S3 lifecycle rule to handle this? No, this is not true. The non-current object versions should be expired provided the rule is correctly defined and enough time has elapsed as explained above.
Further, you are unable to see the expiration header for non-current object version because this header is returned only for current version of objects. Non-current versions and delete markers do NOT return the "Expiration" response header in output of 'head-object" API.
I hope the above addresses your query.
Thank you.
Conteúdo relevante
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 2 anos