我需要使用put_对象指定标记,如下所示:
s3client = boto3.client('s3')
response = s3client.put_object(Bucket = dest_bucket_name, Body = body, Key = dest_key, Tagging = tagging, ACL = acl )
我的问题是我用什么数据结构来标记变量?
我见过各种各样的例子,但我不能让它们发挥作用。例如:
tagging = {'TagSet' : [
{
'Key': 'voiceid',
'Value': polly_voice
},
{
'Key': 'author',
'Value': book_author
},
. . .
]
}
给我
"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'>"
我知道它需要一个字符串,但是如何指定key:value对呢?我发现的所有示例都使用了一些特定的数据结构,如我的示例中所示。
我怀疑这会有什么不同,但我是在lambda函数中做的。