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.

已提問 4 個月前檢視次數 129 次
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
已回答 4 個月前
profile picture
專家
已審閱 2 個月前
  • aws s3api list-multipart-uploads --bucket <Bucketname> gives response "None None"

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南