You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Object lifecycle management allows you to define rules that automatically transition objects between storage classes or delete them based on conditions like age, storage class, or version status. This is essential for cost optimisation and data governance — ensuring that data moves to cheaper storage as it ages and is deleted when no longer needed.
Lifecycle rules are configured at the bucket level. Each rule consists of:
Cloud Storage evaluates lifecycle rules once per day (asynchronously). Changes are not instantaneous — there may be a delay of up to 24 hours.
Transitions an object to a different (colder) storage class:
{
"lifecycle": {
"rule": [
{
"action": { "type": "SetStorageClass", "storageClass": "NEARLINE" },
"condition": { "age": 30 }
},
{
"action": { "type": "SetStorageClass", "storageClass": "COLDLINE" },
"condition": { "age": 90 }
},
{
"action": { "type": "SetStorageClass", "storageClass": "ARCHIVE" },
"condition": { "age": 365 }
}
]
}
}
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.