Skip to main content
Solved

How to add tags to an S3 object?


someonesomeones

I'm uploading objects to my S3 bucket using the S3Connector (Action: Upload) and I see that I can add metadata but it looks like I can't add any tags for my new object. The lifecycle rules in my bucket depend on my objects being properly tagged. Is there any way to achieve this?

Best answer by david_r

I've not tested it myself, but look into if it's possible to use the Metadata headers in the S3Connector:

http://docs.safe.com/fme/2020.0/html/FME_Desktop_Documentation/FME_Transformers/Transformers/s3connector.htm

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-object-metadata.html

Last resort would be to use the boto3 libraries (they're already installed with FME) in a PythonCaller to manually add tags after the S3Connector.

View original
Did this help you find an answer to your question?

3 replies

david_r
Celebrity
  • Best Answer
  • June 16, 2020

I've not tested it myself, but look into if it's possible to use the Metadata headers in the S3Connector:

http://docs.safe.com/fme/2020.0/html/FME_Desktop_Documentation/FME_Transformers/Transformers/s3connector.htm

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-object-metadata.html

Last resort would be to use the boto3 libraries (they're already installed with FME) in a PythonCaller to manually add tags after the S3Connector.


someonesomeones
david_r wrote:

I've not tested it myself, but look into if it's possible to use the Metadata headers in the S3Connector:

http://docs.safe.com/fme/2020.0/html/FME_Desktop_Documentation/FME_Transformers/Transformers/s3connector.htm

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-object-metadata.html

Last resort would be to use the boto3 libraries (they're already installed with FME) in a PythonCaller to manually add tags after the S3Connector.

When using custom metadata headers the key-value pairs still fall under the "Metadata" property of the object and not the "Tags" property. It would be nice to have a new section in the S3Connector similar to the Metadata one but specifically for tags.

For now, I think the best option is to go with the PythonCaller approach. Thanks!


david_r
Celebrity
  • June 16, 2020
someonesomeones wrote:

When using custom metadata headers the key-value pairs still fall under the "Metadata" property of the object and not the "Tags" property. It would be nice to have a new section in the S3Connector similar to the Metadata one but specifically for tags.

For now, I think the best option is to go with the PythonCaller approach. Thanks!

Interesting, thanks for sharing that.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings