这不是我想要的确切答案,但它现在似乎有效 .
我不确定如何维护权限,但我可以手动将其设置为public-read或其他我需要的类型 .
这是来自boto3 copy_object的可能值:
'private' | 'public-read' | 'public-read-write' | 'authenticated-read' | 'aws-exec-read' | 'bucket-owner-read' | 'bucket-owner-full-control'
import boto3
s3 = boto3.resource('s3')
copy_source = {
'Bucket': 'mybucket',
'Key': 'mykey'
}
extra_args = {
'ACL': 'public-read'
}
s3.meta.client.copy(copy_source, 'otherbucket', 'otherkey', extra_args)
然后,我意识到需要更多权限才能执行此操作 . 我不确定它现在实际需要哪个权限,但我收到这些错误:
i)调用CopyObject操作时发生错误(AccessDenied):访问被拒绝 .
ii)调用CreateMultipartUpload操作时发生错误(AccessDenied):拒绝访问 .
它在我添加“s3:PutObjectAcl”策略后起作用 .