Configuring AWS S3 Lifecycle to Abort and Delete Parts Generated by Multipart Upload

Yst@IT
3 min readNov 18, 2019

--

What is Multipart Upload parts, please refer: What is AWS S3 GlacierStagingStorage Cost

This is what I want to eliminate:

S3 bucket Lifecycle

Since the uncompleted parts cannot be seen from console, let’s check it out from CLI. A snippet of how it looks like.

aws s3api list-multipart-uploads --bucket YourBucketName

S3 bucket Lifecycle

I want to know total uncompleted files.

aws s3api list-multipart-uploads --bucket YourBucketName | grep “OWNER” | wc -l

S3 bucket Lifecycle

It is confirmed that uncompleted multi uploaded parts exist, lets configure a bucket lifecycle to abort the upload and delete associated parts. Start by clicking on the bucket then Management.

S3 bucket Lifecycle

Add a lifecycle rule, give your rule a name then click next.

S3 bucket Lifecycle

We are not doing Storage class transition so click next.

S3 bucket Lifecycle

Configure as the image below to abort the multipart uploads and set your desire days. Make sure to set days longer then the actual days needed to upload the file, otherwise your upload will be aborted and deleted while still uploading. Click Next to the review page.

S3 bucket Lifecycle

Review the settings and click save.

S3 bucket Lifecycle

Finished view of the bucket lifecycle configuration, and that’s it! Your uncompleted parts generated by multipart upload will be deleted according to the days you configured in the step.

S3 bucket Lifecycle

--

--

Yst@IT

Cloud Solution Architect, focusing on Oracle Cloud Infrastructure currently.