Creating two-way replication rules for your Multi-Region Access Point - Amazon Simple Storage Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Creating two-way replication rules for your Multi-Region Access Point

Replication rules enable automatic and asynchronous copying of objects across buckets. A two-way replication rule (also known as a bi-directional replication rule) ensures that data is fully replicated between two or more buckets in different Amazon Web Services Regions. When two-way replication is set up, a replication rule from the source bucket (DOC-EXAMPLE-BUCKET-1) to the bucket containing the replicas (DOC-EXAMPLE-BUCKET-2) is created. Then, a second replication rule from the bucket containing the replicas (DOC-EXAMPLE-BUCKET-2) to the source bucket (DOC-EXAMPLE-BUCKET-1) is created.

Like all replication rules, you can apply the two-way replication rule to the entire Amazon S3 bucket or a subset of objects filtered by a prefix or object tags. You can also keep metadata changes to your objects in sync by enabling replica modification sync for each replication rule. You can enable replica modification sync through the Amazon Web Services Management Console, Amazon SDKs, REST API, or Amazon CloudFormation.

To monitor the replication progress of objects and object metadata in Amazon CloudWatch, enable S3 Replication metrics and notifications. For more information, see Monitoring progress with replication metrics and Amazon S3 event notifications.

Warning

If you use the Amazon Web Services Management Console to create replication rules from the Replication rules section of the Multi-Region Access Points page (as described in the following procedure), any pre-existing replication rules for the specified buckets are replaced.

To add to or modify existing replication rules instead of replacing them, go to each bucket's Management tab in the console, and then edit the rules in the Replication rules section. You can also add to or modify existing replication rules by using the Amazon Command Line Interface (Amazon CLI), Amazon SDKs, or REST API. For more information about modifying replication configurations, see Replication configuration.

To create a two-way replication rule for your Multi-Region Access Point

  1. Sign in to the Amazon Management Console.

  2. Open the Amazon S3 console at https://console.amazonaws.cn/s3/.

  3. In the left navigation pane, choose Multi-Region Access Points.

  4. Choose the Multi-Region Access Point that you want to update.

  5. Choose the Replication and failover tab.

  6. Scroll down to the Replication rules section, and then choose Create replication rules.

  7. On the Create replication rules page, choose the Replicate objects among all specified buckets template. The Replicate objects among all specified buckets template sets up two-way replication (with failover capabilities) for your buckets.

    Important

    When you create replication rules by using this template, they replace any existing two-way replication rules that are already assigned to the bucket.

    To add to or modify any existing replication rules instead of replacing them, go to each bucket's Management tab in the console, and then edit the rules in the Replication rules section. You can also add to or modify existing replication rules by using the Amazon CLI, SDKs, or REST API. For more information, see Replication configuration.

  8. In the Buckets section, select at least two buckets that you want to replicate objects from. All buckets chosen for replication must have S3 Versioning enabled, and each bucket must reside in a different Amazon Web Services Region. For more information about S3 Versioning, see Using versioning in Amazon S3 buckets.

  9. In the Replication rule configuration section, choose whether the replication rule will be Enabled or Disabled when it's created.

    Note

    You can't enter a name in the Replication rule name box. Replication rule names are generated based on your configuration when you create the replication rule.

  10. In the Scope section, choose the appropriate scope for your replication.

    • To replicate the whole bucket, choose Apply to all objects in the bucket.

    • To replicate a subset of the objects in the bucket, choose Limit the scope of this rule using one or more filters.

      You can filter your objects by using a prefix, object tags, or a combination of both.

      • To limit replication to all objects that have names that begin with the same string (for example pictures), enter a prefix in the Prefix box.

        If you enter a prefix that is the name of a folder, you must use a / (forward slash) as the last character (for example, pictures/).

      • To replicate all objects that have one or more object tags, choose Add tag and enter the key-value pair in the boxes. To add another tag, repeat the procedure. For more information about object tags, see Categorizing your storage using tags.

  11. Scroll down to the Additional replication options section, and select the replication options that you want to apply.

    Note

    We recommend that you apply the following options, especially if you intend to configure your Multi-Region Access Point to support failover:

    • Replication time control (RTC) – To replicate your data across different Regions within a predictable time frame, you can use S3 Replication Time Control (S3 RTC). S3 RTC replicates 99.99 percent of new objects stored in Amazon S3 within 15 minutes (backed by a service-level agreement). For more information, see Meeting compliance requirements using S3 Replication Time Control (S3 RTC).

    • Replication metrics and notifications – Enable Amazon CloudWatch metrics to monitor replication events.

    • Replica modification sync – Enable replica modification sync for each replication rule to also keep metadata changes to your objects in sync. For more information, see Enabling replica modification sync.

    There are additional charges for S3 RTC and CloudWatch replication metrics and notifications. For more information, see Amazon S3 Pricing and Amazon CloudWatch pricing.

  12. If you're writing a new replication rule that replaces an existing one, select I acknowledge that by choosing Create replication rules, these existing replication rules will be overwritten.

  13. Choose Create replication rules to create and save your new two-way replication rules.