How to delete incomplete multipart uploads associated with a deleted S3 bucket?

0

There were thousands of failed multipart upload requests associated with a bucket. Instead of creating a lifecycle rule, I deleted the bucket hoping that it would also remove all the associated incomplete multipart requests immediately, but that didn't work. I recreated the bucket with the same name and added the incomplete multipart uploads rule to the bucket, but that also wasn't successful in reducing the S3 storage usage due to incomplete multipart uploads. Could you kindly guide me on what I can do now to fix this issue?

  • Storage lens values are reduced to reflect only current objects in that bucket after 2 days. However, CloudWatch metrics still display larger, incorrect values, including incomplete multipart values.

asked 3 months ago111 views
1 Answer
0

First you can list out the multipart uploads you have with the AWS CLI command: # aws s3api list-multipart-uploads --bucket <Bucketname>

From that you need to obtain the key and the upload id, that use that in a second command to abort the multipart upload so that the object parts are deleted.
# aws s3api abort-multipart-upload --bucket <Bucket Name> --endpoint-url=<Bucket URL> --key <Object Key> --upload-id <Upload ID>

If you have many multipart uploads, you might create a create a script.

CLI Command Reference: https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html

profile pictureAWS
answered 3 months ago
profile picture
EXPERT
reviewed 2 months ago
  • aws s3api list-multipart-uploads --bucket <Bucketname> gives response "None None"

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions