S3.Object.
copy
(CopySource, ExtraArgs=None, Callback=None, SourceClient=None, Config=None)¶Copy an object from one S3 location to this object.
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')
obj = bucket.Object('otherkey')
obj.copy(copy_source)
{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}
. Note
that the VersionId
key is optional and may be omitted.