copy
(CopySource, Key, ExtraArgs=None, Callback=None, SourceClient=None, Config=None)Copy an object from one S3 location to an object in this bucket.
This is a managed transfer which will perform a multipart copy in multiple threads if necessary.
Usage:
import boto3
s3 = boto3.resource('s3')
copy_source = {
'Bucket': 'mybucket',
'Key': 'mykey'
}
bucket = s3.Bucket('otherbucket')
bucket.copy(copy_source, 'otherkey')
{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}
. Note
that the VersionId
key is optional and may be omitted.