Setting Up Amazon S3 Replication Rules

Arish AhmadArish Ahmad
2 min read
  1. Open the AWS Management Console and navigate to the S3 dashboard.

  2. Click Create bucket.

  3. Select General purpose bucket type.

  4. Write a bucket name, this name must be globally unique.

  5. Select ACLs enabled Object Ownership.

  6. Uncheck Block all public access -> Check the Acknowledgement.

  7. Enable Bucket Versioning.

  8. Click Create bucket.

  9. Create one more bucket with the same configuration.

    One bucket will act as the source and the other as the destination bucket.

  10. Open any bucket by clicking on its name. This bucket will act as a source bucket.

  11. Click on Management.

  12. Click Create replication rule.

  13. Enter a suitable replication name.

  14. Scroll and choose Apply to all objects in the bucket under Choose a rule scope.

  15. Click Browse S3.

  16. Choose the destination bucket.

  17. Click Choose path.

  18. Select Create new role under IAM role.

  19. Click Save.

  20. Select any under Replicate existing objects? objects click Submit.

  21. Open the source bucket and upload a file.

  22. Open the destination bucket, and you'll find the uploaded file there as well.

  23. Go to the source bucket.

  24. Select the bucket -> Copy URL -> Paste the URL in the other browser tab. You'll not be able to access the file. Try the same in the destination bucket too, you'll get the same result.

  25. In the source bucket, Select the object, click on Action -> Make public using ACL -> Make public.

  26. Now access the bucket. Select the bucket -> Copy URL -> Paste the URL in other browser tab, you'll see the contents of the file.

  27. Navigate to the destination bucket, you'll be able to access the file there too.

  28. Now, permanently delete the file in the source bucket.

    Note: Make sure Show versions is enabled when you delete; otherwise, the file will not be permanently deleted.

  29. Now to go destination bucket, you'll see the file in the destination bucket is not deleted.

  30. To delete the replication rule, open the source bucket, click Management, select the replication rule you want to delete under Replication rules, then click Delete and confirm by clicking Delete replication rule.

0
Subscribe to my newsletter

Read articles from Arish Ahmad directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Arish Ahmad
Arish Ahmad

Final-year BTech student specializing in software development. Completed a Flutter internship and amassed three years of project experience, crafting Threads clone, Stream Arbiter, Ticketify, and Google Docs. Proficient in C++, having successfully solved 250+ LeetCode questions.