Creating an Object Storage Replication Policy

Create a replication policy for an Object Storage source bucket.

    1. Open the navigation menu and click Storage. Under Object Storage & Archive Storage, click Buckets.
    2. Select the compartment from the list under List Scope. All buckets in that compartment are listed in tabular form.
    3. Click the bucket for which you're creating the replication policy. The bucket's Details page appears.
    4. Click Replication Policy under Resources. The Replication Policy list appears.
    5. Click Create Policy. The Create Replication Policy dialog box appears.
    6. Complete the following:
      • Name: Accept the default name or enter your own. Object Storage generates a policy name that reflects the current year, month, day, and time, for example, replication-policy-20200129-2230. If you change this name, use letters, numbers, dashes, underscores, and periods.

      • Destination Region: Select the OCI region that contain the destination bucket that you want to replicate to from the list. Your tenancy must be subscribed to a region for you to replicate to that region. See Managing Regions for more information.

      • Destination Bucket: Select the name destination bucket for replication.Click Change compartment to select a bucket in a different compartment. Ensure you have the required policy access for the destination bucket.

    7. Click Create.

    The Console checks the IAM policies that are in place to perform this task successfully. If you see a policy missing warning, you can let the Console try to create any missing policies or copy the missing policy details to the clipboard to email your administrator. If you have the required policies in place, create the replication policy.

    After the policy is created, Replication: Enabled (Source) is added to the bucket information. Objects uploaded to the source bucket after the policy is created are asynchronously replicated to the destination bucket.

  • Use the oci os replication create-replication-policy command and required parameters to create a replication policy for a bucket:

    oci os replication create-replication-policy --bucket-name bucket_name --destination-region destination_region_id --destination-bucket destination_bucket_name [OPTIONS]

    For example:

    oci os replication create-replication-policy --bucket-name MySourceBucket --destination-region us-ashburn-1 --destination-bucket MyDestinationBucket --name MyReplicationPolicy
    {
      "data": {
        "destination-bucket": "MyDestinationBucket",
        "destination-region": "us-ashburn-1",
        "id": "bacb8334-b191-4026-aa65-5e4f5165ae3e",
        "name": "MyReplicationPolicy",
        "status": "ACTIVE",
        "status-message": "The policy is active.",
        "time-created": "2020-02-06T16:44:10+00:00",
        "time-last-sync": "2020-02-06T16:44:20+00:00"
      }
    }

    Objects uploaded to the source bucket after policy creation are asynchronously replicated to the destination bucket.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateReplicationPolicy operation to create a replication policy for a bucket.