> For the complete documentation index, see [llms.txt](https://ibwpang.gitbook.io/aws-csa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ibwpang.gitbook.io/aws-csa/s3-simple-storage-service/34-cross-region-replication.md).

# 3.4 Cross Region Replication

By default, the data in S3 bucket is replicated across multiple facilities in the **same** Region. So, how to enable Cross-Region replication?

Source Bucket (versioning enabled) ------ cross region replication ----> Destination Bucket (versioning enabled).

Go to the properties of your source bucket, and go to Cross-region replication, which can help you to replicate your bucket cross regions automatically.

## Procedures:

* If you want to enable cross region replication, both of your source bucket and your destination bucket should be versioning enabled.&#x20;
* The storage class of your destination bucket can be Standard-IA, because it is a replicated bucket, you may not access it frequently.&#x20;
* The source bucket can be whole bucket or prefix in this bucket. Prefix in this bucket is used to replicate sub-folders of your bucket.&#x20;
* Then you need to create or select a role, which help AWS services to talk to each other.&#x20;
* Finally AWS will automate coping objects across different Regions from your source bucket to your destination bucket.&#x20;

## Tips:

* At the first time, Cross-region replication will not occur automatically, but when you update a version, it will then go through and replicate **all** previous versions. So only when you **update** version of your object, the cross region replication can happen.&#x20;
* The permissions for the objects will be replicated as well.&#x20;
* Replication is **single** direction. The version updating on your objects of destination bucket will **not** be replicated to your source bucket.&#x20;
* One Source - Multiple Destinations replication is **not** supported. If bucket B replicating bucket A, and bucket C replicating bucket B, the version updating of objects in bucket A will be replicated to bucket B, but will **not** be replicated to bucket C. You have to update the version of your object in bucket B manually so that the updating can be replicated to bucket C. S3 doesn't support multiple cross-region replication. You also **cannot** replicate the version updating from bucket A to both of bucket B and bucket C, it is not supported as well.
* Multiple Source - One Destination replication **is** supported (Ryan Kroonenburg didn't talk about this).
* Object deletion: delete marker is a kind of version updating on your object of your bucket, so it also **can** be replicated. It means when you delete your object in source bucket, it will also be deleted in your destination bucket. When you want to restore your object, just delete the delete marker. However, deleting delete marker will **not** be replicated.&#x20;
* Version deletion: as we know version deletion has nothing to do with delete marker, so it cannot be restored. Version deletion will **not** be replicated to your destination bucket.&#x20;

## Cross-Region Replication Conlusion:

* Versioning must be enabled on both the source and destination buckets.
* Regions must be unique, you **cannot** use cross-region replication in a same region.
* Files (objects) in an existing bucket are **not** replicated automatically. All **subsequent** update files will be replicated automatically.
* You cannot replicate to multiple buckets or use daisy chaining (at this time, not sure in the future).
* Delete markers **are** replicated.
* Deleting individual version or delete markers will **not** be replicated.
* Understand what Cross-Region Replication is at a high level, and understand how you can use it to architect for disaster recovery (DR) is enough for exam.
