Build Cloud Storage lifecycle management rules for storage class transitions and deletion.
Last verified: May 2026
{
"rule": [
{
"action": {
"type": "Delete"
},
"condition": {
"age": 365
}
}
]
}Your team's Cloud Storage bill has crept up to $4,500/month across 80 buckets. Audit reveals 70% of storage is in Standard class, but most data is rarely accessed after 30 days. The builder generates a standard policy: transition to Nearline at 30 days, Coldline at 90 days, Archive at 365 days, plus delete noncurrent versions after 30 days. Apply across all 80 buckets via Terraform. After 3 months, monthly cost drops to $1,800. Annual savings: ~$32K.
Google Cloud Storage lifecycle management automatically transitions objects between storage classes or deletes them based on configurable rules. Rules evaluate conditions like object age, creation date, number of newer versions, storage class, and whether the object is live or a noncurrent version. Properly configured lifecycle rules can dramatically reduce storage costs by moving infrequently accessed data to Nearline, Coldline, or Archive classes and cleaning up old versions. This builder helps you define lifecycle rules with correct condition combinations, action types, and storage class transition sequences.
The builder generates Cloud Storage lifecycle configurations as JSON with rule arrays. Each rule has: action (SetStorageClass with target class, or Delete, or AbortIncompleteMultipartUpload), and condition (combinations of age, createdBefore, isLive, numNewerVersions, matchesStorageClass, matchesPrefix, matchesSuffix, daysSinceCustomTime). Output is generated as gsutil lifecycle set commands and Terraform google_storage_bucket.lifecycle_rule blocks.
Always include a rule to abort incomplete multipart uploads after 7 days. Failed uploads can silently accumulate gigabytes of hidden storage costs. This is a one-line rule that prevents a class of unnoticed billing creep.
For versioned buckets, set a rule deleting noncurrent versions after a specific number of days OR when there are >N newer versions. Without this, deleted/overwritten objects accumulate noncurrent versions forever — your bucket size grows linearly with churn even when 'live' object count is stable.
Storage class transitions are one-way (toward colder tiers). If you accidentally tier objects to Archive too aggressively and need them back hot, you must rewrite each object — there's no 'transition back' lifecycle rule. Always use prefix conditions to limit aggressive transitions to specific data sets.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.