I need to specify taggings using put_object as follows:
s3client = boto3.client('s3')
response = s3client.put_object(Bucket = dest_bucket_name, Body = body, Key = dest_key, Tagging = tagging, ACL = acl )
My question is what data structure do I use to for the tagging variable?
I've seen various examples, but I can't get them to work. For example:
tagging = {'TagSet' : [
{
'Key': 'voiceid',
'Value': polly_voice
},
{
'Key': 'author',
'Value': book_author
},
. . .
]
}
gives me
"errorMessage": "Parameter validation failed:\nInvalid type for parameter Tagging, value: {'TagSet': [{'Key': 'voiceid', 'Value': 'Matthew'}, {'Key': 'author', 'Value': 'some guy'},...]}, type: <class 'dict'>, valid types: <class 'str'>"
I see that it's expecting a string, but then how do I specify the key:value pairs? And all the examples I've found use some specific data structure like in my example.
I doubt that this makes any difference, but I'm doing this in a lambda function.