AmazonS3Client.PutBucketTagging puts tags key as a tag value.
AmazonS3Client.PutBucketTagging puts passed tag value as a value
AWSSDK.S3 starting from version 3.3.24 creates buckets tags with wrong value. It puts passed Key as a Value.
It seems that there is a bug in the https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Services/S3/Custom/Model/Tag.cs line 69
there are should be:
xmlWriter.WriteElementString("Value", S3Transforms.ToXmlStringValue(value));
var s3 = new AmazonS3Client(RegionEndpoint.EUWest1);
var res1 = await s3.PutBucketAsync(bucketName);
var res2 = await s3.PutBucketTaggingAsync(new PutBucketTaggingRequest
{
BucketName = bucketName,
TagSet = new List<Tag>
{
new Tag { Key = "my-key", Value = "my-value"}
}
});
var res3 = await s3.GetBucketTaggingAsync(new GetBucketTaggingRequest {BucketName = bucketName});
var tag = res3.TagSet.FirstOrDefault();
if (tag.Key != "my-key" || tag.Value != $"my-value")
Console.WriteLine("Wrong tags");
Create bucket and put some tag
dotnet --info
: .NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.403/Host (useful for support):
Version: 2.1.5
Commit: 290303f510.NET Core SDKs installed:
2.1.403 [/usr/share/dotnet/sdk].NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Contents of project.json/project.csproj:
Agreed, we'll get that fixed up.
This was fixed and released as of AWSSDK.S3 3.3.25.1
Hi,
I used latest version AWSSDK.S3 3.3.31.17 and the same issue happened: AmazonS3Client.PutBucketTagging puts tags key as a tag value.
I then tried version AWSSDK.S3 3.3.25.1 and still the issue remains. Can someone please verify that this issue is indeed fixed? Thanks!
Sorry, ignore my last post. This issue is fixed. Thanks!