DigitalOcean Spaces Lifecycle Rules and Existing Object Handling
0 reputation · 21 Sept 2025, 09:06 UTC
0 reputation · 21 Sept 2025, 09:06 UTC
Determine whether DigitalOcean Spaces lifecycle rules can be applied to objects that already exist in a bucket when the rule is created.
Official documentation states that lifecycle rules affect only objects created after the rule is activated, with no explicit option for retroactive application. The Spaces API does not expose a parameter to trigger rule evaluation on existing objects, and neither the control panel nor the doctl CLI provides a flag for this behavior. It remains unclear if this limitation is intentional, a temporary gap, or if a future update will introduce retroactive support.
Specific questions:
DigitalOcean Spaces lifecycle rules do apply to existing objects. The premise in your question—that rules only affect objects created after rule activation—is incorrect. Spaces evaluates lifecycle policies against each object's creation timestamp (or last-modified date for transitions), not against the rule's creation date. Objects that already satisfy the age or prefix criteria when a rule is created become eligible for expiration or transition during the next backend evaluation cycle.
LastModified timestamp is more than 30 days in the past, regardless of when the rule was added.Yes—implicitly. The standard PutBucketLifecycleConfiguration (or the control panel / doctl equivalent) is sufficient. The backend automatically includes pre-existing objects in its next evaluation.
Not applicable. The current behavior already covers existing objects. DigitalOcean's public docs and changelog do not mention a separate "retroactive" feature because the existing model handles it.
No workarounds are necessary. If you need faster verification, you can:
aws s3 ls or s3cmd to confirm removal of pre-existing objects.Run a one-time test in a disposable bucket:
# Using aws-cli (configured for Spaces endpoint)
aws s3 mb s3://test-lifecycle-bucket --endpoint-url https://nyc3.digitaloceanspaces.com
aws s3 cp old-file.txt s3://test-lifecycle-bucket/ --endpoint-url https://nyc3.digitaloceanspaces.com
# Wait 24h after rule creation, then:
aws s3 ls s3://test-lifecycle-bucket/ --endpoint-url https://nyc3.digitaloceanspaces.com
If the object disappears, the rule applied retroactively as designed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.