I'm hoping someone can help me with an Amazon S3 Cross Region Replication query. I have two Amazon AWS accounts, each with a bucket in a different region. I want to replicate the data from one bucket to another and from what I understand this should be a simple process to create. However, I'm really struggling and I don't know what I'm doing wrong. I've followed a lot of instructions online including going through various AWS tutorials, seeing lots of examples, but I can't get the data to replicate.
I have enabled versioning on both buckets and none of the data is encrypted. However I do have a policy in my source bucket that permits access to the source data through a referral condition so that the data (images in this case) can only be accessed through specific domains. This all works fine and I have a suspicion that this is what is perhaps restricting access from the destination bucket.
I have followed online instructions to set up the replication rules and IAM policies.
So, my source bucket policy is:-
{
"Version": "2012-10-17",
"Id": "http referrer policy",
"Statement": [
{
"Sid": "Allow get requests originated from list",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::SOURCEBUCKET/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"http://www.domain1.com/*",
"https://www.domain2.com/*",
"http://domain3.com/*"
]
}
}
}
]
}
and my destination bucket policy is:-
{
"Version": "2008-10-17",
"Id": "S3-Console-Replication-Policy",
"Statement": [
{
"Sid": "S3ReplicationPolicyStmt1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::MYSOURCEACCIDNUMBER:root"
},
"Action": [
"s3:List*",
"s3:GetBucketVersioning",
"s3:PutBucketVersioning",
"s3:ReplicateObject",
"s3:ReplicateDelete"
],
"Resource": [
"arn:aws:s3:::DESTINATIONBUCKET",
"arn:aws:s3:::DESTINATIONBUCKET/*"
]
}
]
}
Can anyone advise me on how I can (if I need to) add to the source bucket policy that will enable access from the destination bucket? I'm pretty confident the issue is here.
Thanks in advance.