Skip to content

DeleteObjects

Source: src/AWS/S3/DeleteObjects.ts

Runtime binding for s3:DeleteObjects (batch delete).

Bind this operation to a bucket to get a callable that deletes up to 1,000 objects in a single request — the bucket name is injected automatically and s3:DeleteObject/s3:DeleteObjectVersion are granted on the bucket’s objects. Provide the implementation with Effect.provide(AWS.S3.DeleteObjectsHttp).

// init — bind the operation to the bucket
const deleteObjects = yield* AWS.S3.DeleteObjects(bucket);
// runtime — per-key failures are reported in `Errors`, not thrown
const result = yield* deleteObjects({
Delete: {
Objects: [{ Key: "a.txt" }, { Key: "b.txt" }],
Quiet: true,
},
});