Souad
Souad

Reputation: 5094

(MalformedXML) when calling the PutBucketReplication

I'm trying to put a bucket replication cross account by 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

and I get this error:

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

The corresponding Xml is:

<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>

I really don't see what is wrong in the syntax. I followed this documentation: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html#AmazonS3-PutBucketReplication-request-Role

Upvotes: 0

Views: 1663

Answers (1)

Souad
Souad

Reputation: 5094

It seems that

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

is required, even if set to Disabled.

Upvotes: 0

Related Questions