When I try to copy data from public bucket into my own it fails with below error
aws s3 cp s3://awssampledbuswest2/tickit/spectrum/sales/sales_ts.000 s3://<my bkt>/
copy failed: s3://awssampledbuswest2/tickit/spectrum/sales/sales_ts.000 to s3://<my bkt>/sales_ts.000 An error occurred (AccessDenied) when calling the GetObjectTagging operation: Access Denied
Since source path is available to everyone then anyone can try to do the same by replacing <my bkt> with your own.
Surprisingly, I can download file from public bucket into local file system and upload it into my own bucket
aws s3 cp s3://awssampledbuswest2/tickit/spectrum/sales/ . --recursive
and
aws s3 cp sales_ts.000 s3://<my bkt>/
Any explanation why it occurs and how to avoid this error is highly appreciated!
PS. I tried with AWS account owner and with below IAM user but no luck.

A simpler solution is to use --copy-props none while copying
Example:
aws s3 cp s3://source/object-name s3://destination/object-name/ --copy-props none --recursive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With