/ AWS

How to copy between S3 buckets and retain full permissions

When copying or syncing between S3 buckets on AWS using the CLI. If you want the destination bucket owner to have full permission to the objects being inserted in the bucket, you will need to do the following: -

  • For copying a single object - aws s3 cp "s3://<SOURCE_BUCKET>/<OBJECT_NAME>" "s3://<DESTINATION_BUCKET>/<OBJECT_NAME>" --acl "bucket-owner-full-control" --region <REGION_NAME>
  • For syncing buckets - aws s3 sync "s3://<SOURCE_BUCKET>" "s3://<DESTINATION_BUCKET>" --acl "bucket-owner-full-control" --region <REGION_NAME>

The key to both the above statements is --acl "bucket-owner-full-control". Without this, if the owners of your buckets are not the same. Then the destination bucket would not have access to the objects placed within it.

There are probably other options for other policies to be applied. But this resolved my issue. Hopefully if anyone else has the same issue, this post will help them too.

You will need the AWS CLI, find it here. To be able to use the CLI, you will need an Access key, follow this.