Last active
September 14, 2022 12:42
-
-
Save SalvoCozzubo/067125955aa72a5ddd335e6f16fa448a to your computer and use it in GitHub Desktop.
copy file between bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { CopyObjectCommand, S3Client } = require('@aws-sdk/s3-client'); | |
const client = new S3Client({}); | |
const moveFile = async (sourceKey, destBucket, destKey) => { | |
const params = { | |
Bucket: destBucket, | |
Key: destKey, | |
CopySource: sourceKey, | |
}; | |
return client.send(new CopyObjectCommand(params)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment