Skip to content

PutRecords

Source: src/AWS/Kinesis/PutRecords.ts

Runtime binding for kinesis:PutRecords.

Bind this operation to a Stream to write up to 500 records per call — the stream name is injected automatically and kinesis:PutRecords is granted on the stream. Provide the implementation with Effect.provide(AWS.Kinesis.PutRecordsHttp). For unbounded batching with automatic partial-failure retry, use AWS.Kinesis.StreamSink instead.

// init — bind the operation to the stream
const putRecords = yield* AWS.Kinesis.PutRecords(stream);
// runtime — write a batch from a handler
const result = yield* putRecords({
Records: orders.map((order) => ({
PartitionKey: order.id,
Data: new TextEncoder().encode(JSON.stringify(order)),
})),
});
// result.FailedRecordCount > 0 means some entries need re-submission