https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html
Replication requires the following:
The source bucket owner must have the source and destination AWS Regions enabled for their account. The destination bucket owner must have the destination Region enabled for their account.
Both source and destination buckets must have versioning enabled.
Amazon S3 must have permissions to replicate objects from the source bucket to the destination bucket or buckets on your behalf.
If the owner of the source bucket doesn't own the object in the bucket, the object owner must grant the bucket owner
READandREAD_ACPpermissions with the object access control list (ACL).If the source bucket has S3 Object Lock enabled, the destination buckets must also have S3 Object Lock enabled.
- Replication enables automatic, asynchronous copying of objects across Amazon S3 buckets.
- Buckets with object replication configuration is owned by the same AWS account or by different accounts.
- You can replicate objects to a single destination bucket or to multiple destination buckets.
- The destination buckets can be in different or same AWS Regions.
Same-Region Replication (SRR) or Cross-Region Replication (CRR): To automatically replicate new objects as they are written to the bucket use live replication.
To enable SRR or CRR:
- The destination bucket or buckets where you want Amazon S3 to replicate objects
- An AWS Identity and Access Management (IAM) role that Amazon S3 can assume to replicate objects on your behalf
Configured Buckets can be owned by a single account or they can be from a different account.
Destination bucket can be the different or same region
Step 1: Create a source bucket (srcbucket) in a region ( Mumbai ap-south-1) and Enable the versioning.
Step 2: Create a destination bucket (destbucket) in a different region ( North Virginia us-east-1) and enable the versioning.
Step 3: Select Source bucket and Click on Management Tab.
Step 4: Click on Create Replication Rule and Provide the below information
- Replication rule name: ReplicaRule1
- Status: Enable
- Priority: 0
- Source bucket: Apply to all objects in the bucket.
- Select option choose a bucket from this account
- Click on browse s3 button
- Select destination bucket
- Create your own role (this will create something like S3crr_bucket_irfan)
Step 8: Destination Storage class: unchecked
Step 9: Click on save button
Step 10: Upload a file in the source bucket and it should be copied in the destination bucket as well.
Experiment:
1. Delete the file from the source bucket and check whether it is deleted in the destination bucket or not.
2. Try to disable the versioning of either of these buckets.
No comments:
Post a Comment