
Google Associate Cloud Engineer
Get started today
Ultimate access to all questions.
A SysOps admin has set up a lifecycle rule on a multi-regional bucket with object versioning disabled. What will be the effect of the following lifecycle configuration?
{
"rule": [
{
"action": {"type": "Delete"},
"condition": {"age": 30, "isLive": false}
},
{
"action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
"condition": {"age": 365, "matchesStorageClass": "MULTI_REGIONAL"}
}
]
}
A SysOps admin has set up a lifecycle rule on a multi-regional bucket with object versioning disabled. What will be the effect of the following lifecycle configuration?
{
"rule": [
{
"action": {"type": "Delete"},
"condition": {"age": 30, "isLive": false}
},
{
"action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
"condition": {"age": 365, "matchesStorageClass": "MULTI_REGIONAL"}
}
]
}
Real Exam
Explanation:
The correct answer is D. The first rule is designed to delete any object that is older than 30 days and is not the latest version (not live). However, since the bucket does not have versioning enabled, this rule has no effect. The second rule changes the storage class of live objects from Multi-regional to Coldline for objects older than 365 days.
Refer to the GCP documentation on Object Lifecycle Management for more details. The conditions supported for a lifecycle rule include:
- Age: The condition is met when an object reaches a specified age in days, measured from its creation time.
- IsLive: If set to
true
, the condition matches only live objects; iffalse
, it matches only archived objects. Objects in non-versioned buckets are always considered live. - MatchesStorageClass: The condition is met when an object is stored in the specified storage class. For Multi-Regional or Regional Storage objects, include
STANDARD
andDURABLE_REDUCED_AVAILABILITY
in the condition to cover all objects of similar storage class.
Why not the others?
- Option A is incorrect because the first rule does not archive objects but deletes archived objects, and it has no impact on a versioning-disabled bucket.
- Option B is incorrect because the first rule does not delete live objects, only archived ones.
- Option C is incorrect because the first rule has no effect on a versioning-disabled bucket.