I am trying to copy data from one S3 bucket to another in same account using lambda python. Can anyone help.
2
-
What have you done so far? Include any code snippets and attempts you've madeChris Williams– Chris Williams2020-06-06 09:26:59 +00:00Commented Jun 6, 2020 at 9:26
-
Does this answer your question? boto3 - AWS lambda -copy files between bucketsPranav– Pranav2020-06-06 10:17:20 +00:00Commented Jun 6, 2020 at 10:17
Add a comment
|
1 Answer
Use copy_object():
response = client.copy_object(
Bucket='string',
Key='string',
CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'},
...
)
Specify the destination in Bucket and Key, then specify the source in CopySource.
The easiest format for CopySource is: source-bucket/folder/foo.txt
Let us know if you are unfamiliar with writing Lambda functions or using boto3.