Creating S3 bucket replication

Create a replication configuration for a bucket or replace an existing one.

Before you begin

A running IBM Storage Ceph 7 cluster with Ceph object Gateway configured.

About this task

You can create a replication configuration for a bucket or replace an existing one. Specify the replication configuration in the request body. Provide the name of the destination bucket or buckets where you want to replicate objects.

A replication configuration must include at least one rule. Each rule identifies a subset of objects to replicate by filtering the objects in the source bucket.

Procedure

  1. Create a replication configuration file that contains the details of replication.
    { 
        "Role": "arn:aws:iam::account-id:role/role-name", 
        "Rules": [ 
            { 
                "Status": "Enabled", 
                "Priority": 1, 
                "DeleteMarkerReplication": { "Status": "Disabled" }, 
                "Filter" : { "Prefix": ""}, 
                "Destination": { 
                    "Bucket": "BUCKET_NAME" 
                } 
            } 
        ] 
    }
    For example,
    [root@host01 ~]# cat replication.json
    { 
        "Role": "arn:aws:iam::account-id:role/role-name", 
        "Rules": [ 
            { 
                "Status": "Enabled", 
                "Priority": 1, 
                "DeleteMarkerReplication": { "Status": "Disabled" }, 
                "Filter" : { "Prefix": ""}, 
                "Destination": { 
                    "Bucket": "testbucket" 
                } 
            } 
        ] 
    }
  2. Create the S3 API put bucket replication.
    aws --endpoint-url=RADOSGW_ENDPOINT_URL s3api put-bucket-replication --bucket BUCKET_NAME --replication-configuration file://REPLICATION_CONFIIRATION_FILE.json
    For example,
    [root@host01 ~]# aws --endpoint-url=http://host01:80 s3api put-bucket-replication --bucket testbucket --replication-configuration file://replication.json