aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 77 forks source link

Copy-S3Object -TagSet doesn't tag #279

Closed jgard closed 1 year ago

jgard commented 1 year ago

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

Copy-S3Object -BucketName my-bucket1 -Destinationbucket my-bucket1 -Key file1.txt -Destinationkey file2.txt -TagSet @{Key='testtag';Value='testvalue'}

Possible Solution

No response

Additional Information/Context

No response

AWS Tools for PowerShell version used

Both:
AWSPowerShell    4.1.41
AWS.Tools.S3     4.1.104

PowerShell version used

Both:

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Operating System and version

Windows 10 and Windows Server 2019

ashishdhingra commented 1 year ago
ashishdhingra commented 1 year ago

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.

ashishdhingra commented 1 year ago

This should be fixed in AWS.Tools.S3 4.1.140.

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

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.