This lab demonstrates the process of configuring Cross-Region Replication (CRR) between two S3 buckets in seperate regions.
Source Region: Mumbai and Destination Region:Singapore
Task 1:Create and Configure Source and Destination Buckets
Before Cross-Region Replication(CRR) can be enabled,we must first create the source and destination buckets.Versioning must be enabled for both the buckets in order to configure CRR.Any objects that reside in the bucket before versioning is enabled will not be replicated.
1.In the AWS Management console,under Services->Click S3 under Storage.
2.Click Create bucket and the configure Bucket name,Source Region as Mumbai->Click Create.
3.Click on the Source bucket->Click on Properties->Enable Versioning->Click Save.
4.Follow the same steps and Create Destination bucket in Singapore region and enable Versioning.
Task 2:Enable Cross-Region Replication on a Entire Bucket
Cross-Region Replication policies are used to determine which objects in a bucket are replicated.We can replicate an entire bucket,a specific folder within a bucket,or any objects.However,objects that already exist in the bucket before replication is enabled will NOT be replicated.
1.Let’s upload a file in the source bucket.
2.Click on the file Capture.PNG->Click on the Management->Click on Replication->Click on Add rule.
3.Select Entire bucket as Set Source->Click Next->Select Destination bucket(buckets in this account or another account)->Click Next.
4.We need to create a new role so that it can copy files from S3 Source bucket and Replicate to S3 Destination bucket in different region>Click Next->Click Save.
5.The Destination bucket is empty in Singapore region.
5.Upload an file in S3 Source bucket in Mumbai region and it will Replicate the file to S3 Destination bucket in Singapore region.
As you can see the file got replicated to S3 Destination bucket in singapore region.This is how Cross-Region Replication can be enabled on the entire bucket level.
Task 3:Configure Replication of a Single Folder
1.Create a Folder named crr-folder in the S3 Source bucket->Click Save->Click on the Management->Click on Replication->Click Add Rule.
2.Select Prefix or tags ->Enter crr-folder/ ->Select prefix crr-folder/->Click Next->Select the IAM role which we created previously->Enter new Rule Name->Click Next ->Click Save.
3.Now we can see the Cross-Region Replication for folder in the S3 Source bucket configured successfully.Now the same folder will automatically be replicated in the S3 Destination bucket.
4.Now we can see that I have uploaded a file under folder named crr-folder in S3 Source bucket.
5.The same file along with folder got replicated successfully in S3 Destination bucket.
This is how we enable Cross-Region Replication for a folder inside S3 bucket.
NOTE:One more observation here is after enabling the Cross-Region Replication on the S3 Source and Destination buckets,even though we delete an file or object from S3 Source bucket the file will NOT be deleted in S3 Destination bucket.