-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose --metadata-directive for s3 commands #1188
Conversation
Overall I think that this looks okay, but I have some high level comments. The fact that I can run this and get surprising behavior without any warnings or errors is kind of scary: $ aws s3 cp s3://bucket/key s3://bucket/key2 --content-type text/plain Considering the
If I want fine-grained control, I could always pass |
Yes that is the ideal scenario that you laid out. I talked to @jamesls about this. We considered automatically setting One Exposing I would not be opposed to adding a warning, but there is one edge case that comes up: a multipart copy has completely different metadata behavior than a non-multipart copy. For the multipart-copy, it will actually obey the passing of metadata like Let me know what you think. |
@kyleknap, given the complexity of making this simpler and the fact that customers of the high level S3 commands are currently blocked on getting any method of setting this parameter, I'm in favor of merging in this change to unblock those customers. I would like to circle back in the future and think about how best to provide an interface with the least surprise for customers. I don't think that being difficult to implement is a good argument, but increasing customer cost and general inconsistency from the underlying low-level API are both good reasons to punt on this for now until we can come up with a better solution. It feels like this may need to be an opt-in feature. Please add some information about multipart copies to the docs, then 🚢-it! |
@danielgtaylor I updated the wording for the |
FWIW, looks good to me. |
Also touched up code from pr-check script
LGTM 🚢-it! |
Expose --metadata-directive for s3 commands
Before if you specified parameters like
--content-type
,--content-encoding
, etc when you were doing a CopyObject, those values would not be applied to the copied object. To actually use those values you need to specifyREPLACE
for the metadata-directive header. So this exposes the header as--metadata-directive
forcp
andmv
. Note this is the same parameter name as thea3api copy-object
parameter.cc @jamesls @danielgtaylor