Last reviewed: November 20, 2026 (Asia/Shanghai). Official references were retrieved November 19 UTC.
Control S3 incomplete multipart upload costs by listing unfinished uploads explicitly, identifying which AI jobs have abandoned them, and giving the staging prefix an approved maximum upload lifetime. For urgent cleanup, stop the relevant uploader before aborting its exact upload ID, then verify that its parts are gone. A canceled data-preparation or evaluation job can leave stored parts behind even when it never produced a completed input file.
AWS’s multipart upload overview says an initiated upload has no automatic expiry. Uploaded parts remain until the upload is completed or stopped, and their storage continues to incur charges. Application cancellation therefore needs an explicit cleanup path and a lifecycle backstop.
This runbook targets AI platform engineers using S3 general purpose buckets for large staging files. The commands and acceptance checks are proposed procedures; no authenticated bucket, upload, or billing account was inspected for this article.
Find uploads the object list misses
A multipart upload has its own identity before S3 assembles the final object. Inventory that identity rather than inferring cleanup from a normal object listing. Preserve the bucket, object key, upload ID, initiation time, storage class, and corresponding pipeline job. Multiple multipart uploads can use the same key, so the key alone is insufficient for a cleanup decision.
With AWS CLI v2 already configured for an authorized role, set AI_ARTIFACT_BUCKET to the bucket being reviewed. This read-only command collects uploads under an example staging prefix:
aws s3api list-multipart-uploads \
--bucket "${AI_ARTIFACT_BUCKET:?Set AI_ARTIFACT_BUCKET}" \
--prefix 'ai-staging/' \
--output json \
--no-cli-pager > multipart-inventory.json
The CLI command reference
documents Uploads entries with Key, UploadId, Initiated, and StorageClass. It also documents automatic pagination. Keep pagination enabled and avoid --max-items unless the collection explicitly resumes every returned continuation token. One service response can contain at most 1,000 uploads; a successful first page is not a complete inventory.
Run the collection across every approved bucket and staging prefix. Record collection failures as incomplete coverage. An access denial, timeout, or missing bucket is not evidence of zero retained uploads.
For each candidate, list its uploaded parts and sum their sizes, following all part-list pages. The overview documents a limit of 1,000 parts per service response and says parts still uploading are excluded. Treat the total as an observation at a stated time, especially while producers remain active.
Check the pipeline’s job state before classifying the upload. An old upload might belong to a deliberately paused transfer. Conversely, a failed job might have left several upload IDs after restarts. Track each ID separately and identify the owner responsible for its recovery or disposal.
Price the parts already stored
Measure uploaded part bytes rather than the planned final file size. A failed 500 GB export might have uploaded only a small fraction of its output, while repeated attempts might retain several separate sets of parts.
Use this storage-only estimate after converting measured bytes to the applicable billing unit:
remaining storage exposure
= retained billable GB
× applicable price per GB-month
× additional retained fraction of a month
For a synthetic example, 240 billable GB retained for another half-month represents 120 GB-months of exposure. Multiply that quantity by the applicable regional rate. This is an estimate for an assumed stable byte balance, not an AWS price quote or an observed saving. Keep request, transfer, and other pipeline charges outside this storage subtotal.
Check the staging meter before selecting a rate. The multipart overview says in-progress uploads targeting S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive use staging storage billed at S3 Standard storage rates until completion. The intended final storage class does not establish the current part-storage price.
Aborting does not reverse charges already incurred. AWS also documents that deleting incomplete multipart uploads has no early deletion charge, regardless of the specified storage class. Do not import the minimum-duration assumptions for completed archive objects into this calculation.
If staging storage serves several teams, the site’s guide to allocating shared AI gateway costs with separate cost pools provides a reconciliation method. Use an approved storage driver and preserve the original billed total when assigning responsibility.
Give staging uploads a maximum lifetime
The S3 lifecycle guide for incomplete multipart uploads
documents AbortIncompleteMultipartUpload. Its age threshold starts at initiation, not at the most recent uploaded part. After the configured number of days, a matching unfinished upload becomes eligible for abort and removal of its parts.
Choose the interval from the longest legitimate transfer and its permitted recovery window. Seven days below is an illustrative policy, not a universal recommendation. If a workflow legitimately pauses longer, assign it a separately reviewed prefix or choose a longer approved interval before enabling cleanup.
This is one rule to incorporate into the reviewed bucket lifecycle configuration:
{
"ID": "abort-abandoned-ai-staging-uploads",
"Status": "Enabled",
"Filter": {
"Prefix": "ai-staging/"
},
"AbortIncompleteMultipartUpload": {
"DaysAfterInitiation": 7
}
}
For the console workflow, open the bucket’s Management tab and choose Create lifecycle rule. Give the rule a unique name, limit its scope to the staging prefix, and select the action for deleting incomplete multipart uploads. Enter the approved day count, review the scope, and create the rule. Compare the resulting complete configuration with the captured prior state so unrelated rules remain accounted for.
Review existing uploads before enabling it. AWS says the action covers uploads already in progress as well as future uploads. An old matching transfer can therefore become eligible without waiting another seven days from the configuration change. Eligibility is not a promise of immediate deletion at an exact wall-clock deadline.
This lifecycle action does not delete completed objects or affect completed multipart uploads. Completed invocation logs have their own retention requirements; the Bedrock invocation logging cost guide covers those destination and retention decisions.
Abort an abandoned upload without racing a writer
Use targeted cleanup when an abandoned upload should be removed before the lifecycle backstop handles it. The important precondition is control of the producer: a cleanup worker must not fight an uploader that keeps sending parts.
- Confirm the exact transfer. Match bucket, key, upload ID, initiation time, and pipeline job to the reviewed inventory. Resolve any uncertainty about whether the job can still resume.
- Quiesce its producer. Stop further part submissions for that upload and wait for outstanding part requests to settle. Preserve the source data and job evidence needed for any deliberate restart.
- Re-read its state. Check the same upload ID again. If it completed while approval was pending, inspect the completed output and job result instead of recording an abort saving.
- Request the abort. Call
AbortMultipartUploadwith the captured bucket, key, and upload ID through the authorized client. Preserve the request outcome and observation time with that identity. - Verify the remaining parts. Follow the API’s
ListPartsguidance and recheck the multipart inventory after the producer is quiet. Record the actual service responses, then reconcile the affected storage evidence.
The AbortMultipartUpload API reference explains why the last step matters: part uploads already in progress might still succeed or fail after an abort. It can be necessary to abort the same upload more than once to release all part storage. Investigate observed remaining parts and repeat cleanup against that same identity when required; an unbounded retry loop would hide the producer problem.
AWS recommends checking ListParts to ensure the parts list is empty. If a follow-up instead reports NoSuchUpload, preserve that outcome and confirm the upload is absent from a fresh listing, with no outstanding producer activity. A permission error or failed read must remain an unverified result. An upload’s disappearance alone also does not distinguish abort from successful completion.
Prove cleanup with a small staging exercise
Use disposable uploads and synthetic input files to validate the policy before applying it broadly. These are acceptance criteria, not reported test results:
| Exercise | Required observation |
|---|---|
| Leave an unfinished upload in the staging prefix | Inventory records its exact upload ID and uploaded part sizes |
| Complete a separate control upload | The abort-only lifecycle rule leaves its completed object intact |
| Keep a transfer outside the chosen prefix | The staging rule does not select it |
| Review a transfer older than the proposed threshold | Its owner resolves recovery needs before the rule is enabled |
| Interrupt an upload while part requests are active | Cleanup waits for the producer to settle and checks for remaining parts |
| Simulate a denied or incomplete listing | The report marks coverage incomplete and makes no zero-storage claim |
For lifecycle testing, wait for the real eligibility interval and observe the service result. Do not report the experiment as passed merely because the configuration was accepted. For a manual abort, retain the before-and-after upload observations and the part-verification outcome.
Track retained part bytes, upload age, unresolved owners, and verified cleanup outcomes by staging workload. Compare storage evidence over equivalent periods and explain changes in upload volume or new failures. Confirm the relevant billing meter when reporting financial impact; a configuration change by itself is not realized savings.
Keep the result in the pipeline-storage cost category. This cleanup can reduce infrastructure overhead while the number of model calls and token charges stays unchanged. Begin with one staging prefix, reconcile its oldest abandoned upload, and expand only after inventory coverage, producer coordination, and cleanup verification work together.
Sources checked
Four distinct primary AWS references returned HTTP 200 during live public research on November 19 UTC, November 20 in Asia/Shanghai:
- Uploading and copying objects using multipart upload in Amazon S3 supports upload identity, lack of automatic expiry, retained-part billing, part-list limits, staging storage rates, and early deletion treatment.
- Configuring a bucket lifecycle configuration to delete incomplete multipart uploads supports the abort action, initiation-based age, prefix scope, existing-upload coverage, console steps, and the exclusion of completed objects.
- list-multipart-uploads: AWS CLI command reference supports inventory fields, prefix filtering, automatic pagination, and continuation behavior.
- AbortMultipartUpload API reference
supports abort identity, in-flight part races, possible repeated aborts, and verification through
ListParts.
These are currently served official references for an evergreen operating task. No page-specific revision date was established. Retrieval confirms current public availability; the account’s actual configuration, workload lifetimes, and applicable billing terms still determine the rollout.