What is the correct answer for below question?
If you have object versioning enabled on a multi-regional bucket, what will the following lifecycle config file do?
Mod Edit: It looks to me like the question originally posted here was stolen (by someone, but probably not Darrin!) from the actual exam, so it has beed removed. Also, in the future, we should try to start discussions by asking questions about points to clarify in our understanding, not just copy-pasting questions we come across. Something like this:
I’m trying to better-understand Object Lifecycle Management. In particular, what happens if a configuration says to delete a file and then later move it to a different storage class? How does lifecycle management relate to object versioning?
Hi Darrin. Here are some valuable quotes from the documentation about how Object Lifecycle Management works:
In a bucket with versioning enabled, deleting a live object archives the object, while deleting an archived object deletes the object permanently.
So if the Lifecycle Management configuration says to delete live objects that were added to the bucket, those objects will actually become archived (non-live) objects, instead.
From the same page:
SetStorageClass: Change the storage class of live and/or archived objects. This action can be applied to both versioned and non-versioned objects.
Later on down the page, it also talks about the conditions you can set on applying a rule:
The following conditions are supported for a lifecycle rule: Age: This condition is satisfied when an object reaches the specified age (in days). ... The time when the Age condition is considered to be satisfied is calculated by adding the specified value to the object creation time. ... This is true even if the object becomes archived through object versioning sometime after its creation. ... IsLive: If the value is true, this lifecycle condition matches only live objects; if the value is false, it matches only archived objects. For the purposes of this condition, objects in non-versioned buckets are considered live. MatchesStorageClass: This condition is satisfied when an object in the bucket is stored as the specified storage class.
I hope this helps clarify, in your mind, how this works. Please feel free to ask more questions about anything you still don’t understand after reading that documentation page.