Menu
Amazon Simple Storage Service
Console User Guide (API Version 2006-03-01)

Managing Cross-Region Replication

Important

This is the User Guide for the old Amazon S3 console. If you are looking for the User Guide for the new Amazon S3 console, see Welcome to the New Amazon S3 Console User Guide.  

Cross-region replication is the automatic, asynchronous copying of objects across buckets in different AWS regions. By activating cross-region replication, Amazon S3 will replicate newly created objects, object updates, and object deletions from a source bucket into a destination bucket in a different region. Cross-region replication has specific requirements that define what can and cannot be replicated across regions based on how the object is created and how it is encrypted. For more information, see Cross-Region Replication the Amazon Simple Storage Service Developer Guide.

Enable Cross-Region Replication

In this section, you'll learn how to enable cross-region replication in the Amazon S3 console.

To enable cross-region replication between buckets

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. Cross-region replication requires that versioning is enabled on both your source bucket and your destination bucket in a different region. For more information, see Enabling Bucket Versioning.

    Important

    If you have an object expiration lifecycle policy in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle policy will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle Configuration for a Bucket with Versioning.

  3. In the Buckets list, choose the bucket for which you want to enable cross-region replication, choose Properties, and then choose Cross-Region Replication.

  4. Choose Enable Cross-Region Replication.

  5. Choose the Source—either the entire bucket or a prefix within the bucket.

  6. Choose the Destination Region from the drop-down list.

  7. Choose the Destination Bucket from the drop-down list. If you do not see your desired destination bucket in the list, confirm that the bucket exists in the region you selected above, and that you have enabled versioning on that bucket. If no buckets exist in that region and you click Create a new bucket from the list, you'll be prompted to create a new bucket with versioning enabled in that destination region.

  8. Optionally choose the Destination Storage Class from the drop-down list.

    Amazon S3 uses this storage class when creating object replicas. By default CRR uses the same storage class as the source object.

  9. In order to perform cross-region replication of objects on your behalf, Amazon S3 will need to use an IAM role that you have created. Click Create/Select IAM Role and a new browser tab will open up within the AWS Identity and Access Management (IAM) console.

    On this page, you'll select an existing IAM role or create a new one that will allow Amazon S3 to replicate objects from the source bucket to the destination bucket on your behalf. By default, Amazon S3 will generate a policy document for the IAM role that matches the source and destination buckets you've chosen. To continue, click Allow to return to the Amazon S3 console. For more information about IAM roles, see IAM Roles in the IAM User Guide.

  10. Choose Save.

You have now enabled cross-region replication between two buckets. The time it takes for Amazon S3 to replicate an object depends on the object size. For large objects, it can take up to several hours.

Note

Metadata for an object remains identical between original objects and replica objects. Lifecycle rules abide by the creation time of the original object, and not by when the replicated object became available in the destination bucket. However, lifecycle actions on objects pending replication will not resolve until the replication has completed.

Disable or delete Cross-Region Replication

In this section, you'll learn how to disable cross-region replication in the Amazon S3 console. The configuration for cross-region replication can be partially deleted, in the case of removing prefixes, or fully disabled.

To fully disable cross-region replication between two buckets in the Amazon S3 console

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the Buckets list, choose the bucket for which you want to disable cross-region replication, choose Properties, and then choose Cross-Region Replication .

  3. Choose Do Not Enable Cross-Region Replication.

  4. Choose Save.

This action fully disables cross-region replication between two buckets. The previous cross-region replication configuration is not deleted, but disabled, and you can re-enable that configuration at any time by choosing Enable Cross-Region Replication and then choosing Save.

To partially delete the cross-region replication configuration between two buckets by removing prefixes

  1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the Buckets list, choose your source bucket, choose Properties, and then choose Cross-Region Replication.

  3. Choose the delete icon next to the prefix that you want to remove from the cross-region replication configuration.

  4. Choose Save.

This action deletes the prefix from the configuration for cross-region replication for these two buckets. This means that all objects with that prefix will no longer be replicated across regions.

Note

If you delete all the prefixes from your cross-region replication configuration in the Amazon S3 console, then the Amazon S3 console assumes that you want to enable cross-region replication on every object in the source bucket. That means that every newly created object, object update, and object deletion in the source bucket will be replicated into the destination bucket, regardless of prefix.

You can't suspend versioning on your buckets until the replication configuration is deleted. The Amazon S3 console allows you to disable replication, but it will not delete it. You can delete your cross-region replication configuration using the following AWS Command Line Interface (CLI) command.

Copy
aws s3api delete-bucket-replication --bucket BUCKETNAME

For information about using the CLI, go to Getting Set Up with the AWS Command Line Interface in the AWS Command Line Interface User Guide.