(MalformedXML) 调用 PutBucketReplication 时

(MalformedXML) when calling the PutBucketReplication

我正在尝试通过 AWS CLI 进行存储桶复制跨账户

aws s3api put-bucket-replication --bucket "mybucket" --replication-configuration "{\"Role\": \"arn:aws:iam::xxxxxxx:role/buckets-replication\", \"Rules\": [{ \"Status\": \"Enabled\", \"Priority\": 1, \"DeleteMarkerReplication\": { \"Status\": \"Enabled\" }, \"Destination\": { \"Bucket\": \"arn:aws:s3:::mybucket-destination\", \"AccessControlTranslation\": { \"Owner\": \"Destination\" } } }]}" --region "eu-west-1" --profile default

我得到这个错误:

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

对应的Xml为:

<ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Role>string</Role>
   <Rule>
      <Status>string</Status>
      <Priority>integer</Priority>
      <DeleteMarkerReplication>
         <Status>string</Status>
      </DeleteMarkerReplication>
      <Destination>
         <Bucket>string</Bucket>
         <AccessControlTranslation>
            <Owner>string</Owner>
         </AccessControlTranslation>
      </Destination>
   </Rule>
</ReplicationConfiguration>

我真的看不出语法有什么问题。我遵循了这个文档:https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html#AmazonS3-PutBucketReplication-request-Role

好像

<DeleteMarkerReplication>
     <Status>string</Status>
</DeleteMarkerReplication>

是必需的,即使设置为已禁用。