Life Cycle Management

Many applications require the functionality to delete or archive the older resources after a certain amount of time. The following are some example use cases:

  1. Move files older than 1 year from Multi Regional Storage to Coldline Storage.
  2. Delete files older than 5 years from Coldline storage.
  3. Keep only a few recent object versions if you have Object Versioning.

Luckily, Google Cloud Storage provides a functionality called Object Life Cycle Management to handle this type of operations automatically based on the configurations. The configurations are set of rules that apply to bucket where you have enabled this feature.

For example, the following rule specifies that it delete the files older than 365 days:

// lifecycle.json
{
"lifecycle": {
"rule":
[
{
"action": {"type": "Delete"},
"condition": {"age": 365}
}
]
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset