Reputation: 113
I am trying to copy data from one S3 bucket to another in same account using lambda python. Can anyone help.
Upvotes: 1
Views: 180
Reputation: 270224
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.
Upvotes: 3