Skip to content

BucketEventSource

Source: src/AWS/Lambda/BucketEventSource.ts

Connects an S3 bucket notification stream to the current Lambda function.

This layer listens for bucket notifications routed through the Lambda runtime and exposes them as an Effect.Stream, while the companion policy configures the invoke permission and bucket notification binding during deployment.

yield* BucketEventSource.bind(
bucket,
{ events: ["s3:ObjectCreated:*"] },
(events) => Stream.runForEach(events, (event) => Effect.log(event.key)),
);