We need to enable below Object Lifecycle rules in GCP Cloud Storage bucket
If a non current object version is not accessed for 100 days and its current storage class is either of
STORAGE, MULTI_REGIONAL and DURABLE_REDUCED_AVAILABILITY, move that object toNearlineStorageIf a object version is not accessed for 100 days and its current storage class is
Nearline, move it toColdlinestorage ClassDelete from
Coldlinestorage if objects are not accessed for 100 days fromColdlineStorage.Keep 2 non current version of file
To implement the above rules , the following rules were applied to bucket
{
"lifecycle": {
"rule": [
{
"action": {
"type": "SetStorageClass",
"storageClass": "NEARLINE"
},
"condition": {
"age": 100,
"isLive": false,
"matchesStorageClass": ["REGIONAL", "STANDARD", "DURABLE_REDUCED_AVAILABILITY"]
}
},
{
"action": {
"type": "SetStorageClass",
"storageClass": "COLDLINE"
},
"condition": {
"age": 100,
"matchesStorageClass": ["NEARLINE"]
}
},
{
"action": { "type": "Delete"},
"condition": {
"age": 100,
"matchesStorageClass": ["COLDLINE"]
}
},
{
"action": { "type": "Delete"},
"condition": {
"numNewerVersions": 2
}
}
]
}
}
Need clarification on below
It is showing the rules are applied successfully but will it work practically. Since we are moving non current versions from NEARLINE to COLDLINE which are not accessed for 100 days do I need to add "isLive": false in Rule 2 . Also does we need it for rule 3 too .
{ "action": { "type": "SetStorageClass", "storageClass": "COLDLINE" }, "condition": { "age": 100, "isLive": false "matchesStorageClass": ["NEARLINE"] }},
{ "action": { "type": "Delete"}, "condition": { "age": 100, "isLive": false "matchesStorageClass": ["COLDLINE"] } },Also does it makes sense to move directly to COLDLINE from STANDARD storage class as we are considering access above 100 days
Any suggestions ?