Mohammad Abbas Sayed
Mohammad Abbas Sayed

Reputation: 113

Aws copy data from one S3 bucket to another on same account using lambda python

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

Answers (1)

John Rotenstein
John Rotenstein

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

Related Questions