Enabling S3 cross-region replication

Cross-region replication (CRR) enables automatic, asynchronous copying of objects across S3 buckets in different regions. Buckets that are configured for CRR can be owned by the same user. Objects may be replicated to a single destination bucket or multiple destination buckets.

To enable CRR, you need to add replication configuration to your source bucket. The minimum configuration must provide the destination buckets where you want to replicate objects and a user with the role that enables replicating objects on your behalf.


  • CRR only supports copying new S3 objects after it is enabled.


To set up CRR replication

  1. Create two or more S3 buckets, one source bucket and one or multiple destination buckets. You can also use buckets that already exist in the S3 cluster. For example, to create the source and destination buckets, use:

    aws s3api create-bucket --bucket source --endpoint-url http://s3.ostor --profile ostor
    aws s3api create-bucket --bucket destination --endpoint-url http://s3.ostor --profile ostor
  2. Enable versioning for these buckets. For example:

    aws s3api  put-bucket-versioning --bucket source --endpoint-url http://s3.ostor --profile ostor \
    --versioning-configuration 'Status=Enabled'
    aws s3api  put-bucket-versioning --bucket destination --endpoint-url http://s3.ostor --profile ostor \
    --versioning-configuration 'Status=Enabled'
  3. Create a replication configuration file. For example, the replication.conf file may look as follows:

    <?xml version="1.0"?>
    <ReplicationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">


    Specifies which objects to replicate and where to store the replicas.
    Specifies whether to replicate delete markers. If the Filter element is specified, you must also include the DeleteMarkerReplication element.
    A container for information about the replication destination and its configuration.
    Indicates which rule has precedence whenever two or more replication rules conflict.
    The name of the bucket where you want to store the results.
    Specifies whether the rule is enabled. Valid values are Enabled or Disabled.
    A unique identifier for the rule. The value must be up to 255 characters long.
    The ID of the user that is used to replicate objects on your behalf. In the example above, it is ccb13f7bc586ace0.
  4. Configure the source bucket for CRR by specifying the replication configuration file. For example:

    aws s3api put-bucket-replication --bucket source --endpoint-url http://s3.ostor --profile ostor \
    --replication-configuration file://replication.conf