Why it matters
These parts never appear in object listings, so they can grow for years without anyone noticing.How nOps finds it
nOps uses S3 Storage Lens metrics for each bucket: the bytes held by incomplete multipart uploads older than 7 days. The saving is that storage at the bucket’s billed Standard storage rate.Before you start
S3 Storage Lens metrics for the bucket, and permission to update lifecycle rules (s3:GetLifecycleConfiguration, s3:PutLifecycleConfiguration).
How to implement
- Save the bucket’s current lifecycle rules:
aws s3api get-bucket-lifecycle-configuration --bucket BUCKET. - Add a rule with Delete expired object delete markers or incomplete multipart uploads → Incomplete multipart uploads → 7 days (
AbortIncompleteMultipartUploadwithDaysAfterInitiation7), keeping every existing rule. - Write back the full merged configuration with
put-bucket-lifecycle-configuration, since it replaces every rule. - Update Terraform or CloudFormation with the same rule.
- Check in Storage Lens that the incomplete-upload bytes fall over the following days.
Risks and considerations
- Completed objects are never affected.
- Uploads older than 7 days are aborted and cannot be resumed. If you have uploads that legitimately take longer, choose a longer period.
- To roll back, restore the saved lifecycle rules. Uploads already aborted cannot be recovered.
FAQs
Why can't I see these parts in the bucket?
Why can't I see these parts in the bucket?
Parts of an unfinished upload are not objects. You can list them with
aws s3api list-multipart-uploads.