Copying is the easy part! Use the AWS Command-Line Interface (CLI):
aws s3 sync s3://source-bucket s3://destination-bucket
Permissions that you will need to check.
What you will need to consider is how to permit access to copy the files. Let's say you have:
- Account A with Bucket A
- Account B with Bucket B
- You wish to copy from Bucket A to Bucket B
You should run the sync command from a user ("User B") in Account B that has permissions to write to Bucket B.
You will also need to add a Bucket Policy to Bucket A that specifically permits access by User B. The policy would look something like:
{
"Id": "Policy1",
"Version": "2019-01-15",
"Statement": [
{
"Sid": "ReadOnlyAccess",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::my-bucket/*",
"Principal": {
"AWS": [
"arn:aws:iam::123456789012:user/user-b"
]
}
}
]
}