Skip to content

CopyObject

Source: src/AWS/S3/CopyObject.ts

Runtime binding for s3:CopyObject.

Bind this operation to the destination bucket to get a callable that copies objects server-side — no download/re-upload round trip. CopySource names the source as "source-bucket/key". Provide the implementation with Effect.provide(AWS.S3.CopyObjectHttp).

// init — bind the operation to the destination bucket
const copyObject = yield* AWS.S3.CopyObject(bucket);
// runtime — promote a staged upload to its final key
yield* copyObject({
CopySource: `${bucketName}/incoming/report.pdf`,
Key: "published/report.pdf",
});