How to stop the aws cli from aborting multipart uploads #1
stefansundin
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When you abort a multipart upload that was started with the aws cli, it automatically aborts it. There is no way to disable this "feature" in the aws cli.
The most effective way to stop this from happening is to create a bucket policy that denies the
s3:AbortMultipartUpload
action. You can also use an IAM policy to accomplish this, but restricting the action with a bucket policy ensures that it applies to all users, including the root account.Here's an example bucket policy:
bucketname
with the name of your bucket.With this in place, you'll be sure that the data is not deleted by the aws cli when you abort the upload with Ctrl-C. The aws cli does not provide a good way to resume an interrupted upload though. Luckily you can use shrimp to resume an upload that started by the aws cli, just be sure that you've stopped the aws cli before you resume the upload with shrimp.
I've mentioned this in the README file, but it is worth repeating: please set up a bucket policy to clean up abandoned multipart uploads. If you'd like you can have it wait a full month before cleaning them up, but be sure that you eventually either complete the upload or abort it, because you're being billed for the parts that were uploaded.
Beta Was this translation helpful? Give feedback.
All reactions