在为S3存储桶自动创建清单时会遇到一些麻烦。 由于某些原因,在将aws sdk与put_bucket_inventory_configuration()一起使用时,我不断收到MalformedXML错误。
我检查了文档和以前的帖子,发现了类似的问题,但无法得出任何结论。以下是我的代码和错误...
s3Client.put_bucket_inventory_configuration(
Bucket=profile + '-inv',
Id='1234',
InventoryConfiguration={
'Destination': {
'S3BucketDestination': {
'AccountId': profile,
'Bucket': profile + '-inv',
'Format': 'CSV',
'Prefix': ''
}
},
'IsEnabled': True,
'Filter': {
'Prefix': ''
},
'Id': '123',
'IncludedObjectVersions': 'Current',
'OptionalFields': [
'Size',
'LastModifiedDate',
'StorageClass'
],
'Schedule': {
'Frequency': 'Daily'
}
}
)
botocore.exceptions.ClientError: An error occurred (MalformedXML) when calling the PutBucketLifecycleConfiguration operation: The XML you provided was not well-formed or did not validate against our published schema