Closed jgard closed 1 year ago
Per documentation for S3 CopyObject service API operation, the x-amz-tagging is the tag-set for the object destination object and this value must be used in conjunction with the TaggingDirective
. The x-amz-tagging-directive specifies whether the object tag-set are copied from the source object or replaced with tag-set provided in the request.
Per CopyObjectRequestMarshaller, the tagging directive is set to REPLACE
if there are any items in TagSet
, else it is set to COPY
.
AmazonS3Util.TagSetToQueryString() converts the tagset to URL encoded query string format.
The TagSet parameter expects an array of Tag objects which consists of Key
and Value
properties. The @{} is the Hash table literal syntax
.
Reproducible using Copy-S3Object -BucketName testbucket -Destinationbucket testbucket -Key src.txt -Destinationkey src-copy.txt -TagSet @{Key='testtag';Value='testvalue'}
.
Root cause: TagSet
parameter passed by user is not consumed and passed down the line to CmdletContext
here.
This should be fixed in AWS.Tools.S3 4.1.140.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
Copy-S3Object indicates it has a -TagSet parameter to tag the destination object. It does not seem like this does anything. Cloudtrail doesn't show the requestParameters with tags, and the resulting object isn't tagged. Looking at the raw API, AWSCLI, and boto3, all require an additional parameter "tagging directive" to dictate whether tags are to be copied (merged) or replaced by the new tags.
Because Copy-S3Object is lacking that parameter, I'm guessing this is an incompletely implemented feature?
Expected Behavior
The destination object has the tags sent with the command.
Current Behavior
The destination object does not have the tags sent with the command.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS Tools for PowerShell version used
PowerShell version used
Both:
Operating System and version
Windows 10 and Windows Server 2019