S3 Bucket Valid Tag error and workaround

0

Hi
We are transferring document's from SharePoint to AWS S3 using a ETL tool , we are part of the solution , sharing the Author name of the document as Tags for optimal use of S3 . The issue we are facing is that the name has a first name and second name ,eg . Key= Name Value= John,Doe . When we try to tag it , it throws a 403 error . It is probably the comma in the value that is causing it . I have seen the documentation around this
https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#S3TaggingErrorCodeList InvalidTag This request contains a tag key or value that isn't valid. Valid characters include the following: [a-zA-Z+-=._:/]. 400 Bad Request Not supported My question is if there is a workaround I can pass comma as part of the tags to support our business requirements. A quick reply will really help

asked a month ago104 views
2 Answers
1

Unfortunately, there isn't a direct workaround to use commas in S3 object tag values. The S3 tagging system has specific restrictions on allowed characters for tag values, and commas are not among the permitted characters.

To address your business requirement of including author names with both first and last names as tags, you have a few options:

  1. Replace the comma with an allowed character. For example, you could use a hyphen or underscore instead: "John-Doe" or "John_Doe".

  2. Combine the first and last names without any separator: "JohnDoe".

  3. Use separate tags for first name and last name. For example, Key=FirstName Value=John and Key=LastName Value=Doe.

  4. Encode the comma using URL encoding, replacing the comma with "%2C". However, this may make the tags less readable.

When tagging S3 objects, it's important to stick to the allowed characters, which include letters, numbers, spaces, and the following special characters: + - = . _ : /

By adjusting your tagging strategy to work within these constraints, you should be able to avoid the 403 error and successfully tag your S3 objects with author information.
Sources
Can we have a bucket name: \b-ds.n | AWS re:Post
Can we add more than one tag at the Time of putting an object? | AWS re:Post

profile picture
answered a month ago
profile picture
EXPERT
reviewed a month ago
  • Additionally error from the ETL tool , this happens only we add comma to the tag : Possible reasons can be failure in URL connection or file access denial, detail: The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch;

0

Comma is not supported, you need to find an alterative. Either, you can use a different character like '' instead of comma but this has the disadvantage that you might have '' in other tags. Alternatively, you can use the object metadata instead of tags. Metadata support ',' in the value. For example, you can set the metadata of the object to

Type: User defined
Key: x-amx-meta-auth
Value: Doe,John
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions