{"id":656,"date":"2020-12-13T04:39:48","date_gmt":"2020-12-13T04:39:48","guid":{"rendered":"https:\/\/www.legendshub.com\/blog\/?p=656"},"modified":"2020-12-15T19:42:01","modified_gmt":"2020-12-15T19:42:01","slug":"s3-cross-account-replication-in-aws-legendshub-blog","status":"publish","type":"post","link":"https:\/\/www.legendshub.com\/blog\/2020\/12\/13\/s3-cross-account-replication-in-aws-legendshub-blog\/","title":{"rendered":"S3 objects replication in AWS &#8211; Legendshub Blog"},"content":{"rendered":"\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"1\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n<p>In this blog we will discuss on  &#8220;How to setup replication in the buckets residing the different AWS accounts ? &#8220;<\/p>\n\n\n\n<p>We will take a scenario in which we have two accounts A and B. We want to replicate the objects from bucket Source in account A to bucket Destination in account B.<\/p>\n\n\n\n<p>First of all open the account A and click on the source bucket. Click on the management and go the replication rules section. Create a new replication rule.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/11\/image-1-1024x171.png\" alt=\"\" class=\"wp-image-658\" width=\"599\" height=\"99\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/11\/image-1-1024x171.png 1024w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/11\/image-1-300x50.png 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/11\/image-1-768x128.png 768w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/11\/image-1.png 1088w\" sizes=\"(max-width: 599px) 100vw, 599px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>In replication rule chose the option accordingly. If you want to limit the rule to filter incase any subfolder or prefix define here. If complete bucket need to be synced select other option.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-2.png\" alt=\"\" class=\"wp-image-717\" width=\"559\" height=\"421\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-2.png 942w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-2-300x226.png 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-2-768x579.png 768w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Select the the destination bucket accordingly if bucket is in same account or if bucket is present in other AWS account.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1005\" height=\"480\" src=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-3.png\" alt=\"\" class=\"wp-image-718\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-3.png 1005w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-3-300x143.png 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-3-768x367.png 768w\" sizes=\"(max-width: 1005px) 100vw, 1005px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>For replication one need to create the proper IAM role. If you are unaware of the permissions need choose option to create a new role. If reference is needed follow policy can be used.<\/p>\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"100\" style=\"\">\n\n<\/div>\n\n\n\n\n<p><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>{<br>&#8220;Version&#8221;: &#8220;2012-10-17&#8221;,<br>&#8220;Statement&#8221;: [<br>{<br>&#8220;Action&#8221;: [<br>&#8220;s3:Get<em>&#8220;, &#8220;s3:ListBucket&#8221; ], <\/em><\/p><p><em>&#8220;Effect&#8221;: &#8220;Allow&#8221;, <\/em><\/p><p><em>&#8220;Resource&#8221;: [ &#8220;arn:aws:s3:::bucketname&#8221;,<\/em><\/p><p><em> &#8220;arn:aws:s3:::bucketname\/*<\/em>&#8220;<br>]<br>},<br>{<br>&#8220;Action&#8221;: [<br>&#8220;s3:ReplicateObject&#8221;,<br>&#8220;s3:ReplicateDelete&#8221;,<br>&#8220;s3:ReplicateTags&#8221;,<br>&#8220;s3:GetObjectVersionTagging&#8221;,<br>&#8220;s3:ObjectOwnerOverrideToBucketOwner&#8221;<br>],<br>&#8220;Effect&#8221;: &#8220;Allow&#8221;,<br>&#8220;Resource&#8221;: &#8220;arn:aws:s3:::buketname\/*&#8221;<br>}<br>]<br>}<\/p><\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1001\" height=\"187\" src=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-4.png\" alt=\"\" class=\"wp-image-719\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-4.png 1001w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-4-300x56.png 300w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-4-768x143.png 768w\" sizes=\"(max-width: 1001px) 100vw, 1001px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next part is important for destination bucket prospective. If you want to replicate all the existing objects or want to replicate only new objects. Generally after replication rule is configured it may take upto 48 hours to replicate but if one selects RTC it will ensure objects are replicated in 15 mins.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"798\" height=\"871\" src=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-5.png\" alt=\"\" class=\"wp-image-721\" srcset=\"https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-5.png 798w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-5-275x300.png 275w, https:\/\/www.legendshub.com\/blog\/wp-content\/uploads\/2020\/12\/image-5-768x838.png 768w\" sizes=\"(max-width: 798px) 100vw, 798px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Note:<\/strong> Replication rules will only work if versioning is enabled on both source and destination bucket.<\/p>\n\n\n\n<p>Once everything is configured save the replication rule.<\/p>\n\n<!-- Quick Adsense WordPress Plugin: http:\/\/quickadsense.com\/ -->\n<div class=\"2c935cf620b701aabbb7cc90bbf4023c\" data-index=\"3\" style=\"float: none; margin:0px 0 0px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<script>\r\n  (adsbygoogle = window.adsbygoogle || []).push({\r\n    google_ad_client: \"ca-pub-5554449970657557\",\r\n    enable_page_level_ads: true\r\n  });\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">In this blog we will discuss on &#8220;How to setup replication in the buckets residing the different AWS accounts ? &#8220; We will take a scenario in which we have two accounts A and B. We want to replicate the objects from bucket Source in account A to bucket Destination in account B. First of all open the account A&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"btn btn-default\" href=\"https:\/\/www.legendshub.com\/blog\/2020\/12\/13\/s3-cross-account-replication-in-aws-legendshub-blog\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":727,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[183,184,150,175,181,180,182,102],"_links":{"self":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/656"}],"collection":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/comments?post=656"}],"version-history":[{"count":6,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions"}],"predecessor-version":[{"id":730,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions\/730"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/media\/727"}],"wp:attachment":[{"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/media?parent=656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/categories?post=656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.legendshub.com\/blog\/wp-json\/wp\/v2\/tags?post=656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}