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.

已提问 3 个月前122 查看次数
1 回答
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
已回答 3 个月前
profile picture
专家
已审核 2 个月前
  • aws s3api list-multipart-uploads --bucket <Bucketname> gives response "None None"

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则