Python Boto3 PutBucketReplication操作:您提供的XML格式不正确或未针对我们发布的架构进行验证

问题描述 投票:2回答:1

我正在尝试使用python boto3更新存储桶的复制规则。但我不断收到错误:botocore.exceptions.ClientError: An error occurred (MalformedXML) when calling the PutBucketReplication operation: The XML you provided was not well-formed or did not validate against our published schema

我正在按照此处的文档进行操作:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.put_bucket_replication

这是我正在运行的功能。谁能看到我传递的xml怎么了?

def apply_bucket_replication_rule(client):
    response = client.put_bucket_replication(
        Bucket= 'my-bucket',
            'Role': 'arn:aws:iam::0123456:role/replicate_s3_buckets',
            'Rules': [
                {
                    'Status': 'Enabled',
                    'Destination': {
                        'Bucket': 'arn:aws:s3:::my-bucket-backup',
                        'Account': '111222333'
                    }
                }
            ]
        },
    )
    print (response)
python amazon-web-services amazon-s3 boto3 boto
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.