Implemented No-overwrite for uploads using cp command #9569
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue : Github Issue #2874
Description of changes:
Customers requested to prevent overwriting of objects. This is done by providing
no-overwrite
header usingifNoneMatch
feature of Amazon S3 which only allows to upload objects that are not present on the bucket. Theno-overwrite
header provides support to multi-part upload as well as works well with othercp
command headers. Customer can be implemented usingaws s3 cp <source> <destination> --no-overwrite
which allows successful uploads when object with the same name is not present on the destination. However, if the user tries to upload the object which is already present at the target bucket using command line, awarning
about skipping the file will be displayed and that object is not allowed to upload to S3 bucket.Testing:
Functional testing is performed to validate the object upload process. This included both scenarios uploading an object when object with same key is already present in the bucket as well as those when the object with same key is not present on bucket. These tests were conducted for both single-part uploads as well as multipart uploads.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.