I have a file contained in a key in my S3 bucket. I want to create a new key, which will contain the same file. Is it possible to do without downloading that file? I'm looking for a solution in Python (and preferably boto library).
+1
A:
S3 allows object by object copy. The CopyObject operation creates a copy of an object when you specify the key and bucket of a source object and the key and bucket of a target destination. Not sure if boto has a compact implementation.
whatnick
2009-09-23 13:24:33
A:
Browsing through boto's source code I found that the Key object has a "copy" method. Thanks for your suggestion about CopyObject operation.
Thotep
2009-09-23 13:53:09
A:
Where bucket is the destination bucket:
bucket.copy_key(new_key,source_bucket,source_key)
Adam Nelson
2010-03-10 15:13:01
This actually reads the key and puts it up in the new bucket - which is not what you want. Sorry.
Adam Nelson
2010-03-10 16:05:19