Skip to content

MergeShards

Source: src/AWS/Kinesis/MergeShards.ts

Runtime binding for kinesis:MergeShards.

Bind this operation to a Stream to merge two adjacent shards of a PROVISIONED-mode stream into one — the stream ARN is injected automatically. Useful for building custom shard-scaling logic (the Stream resource’s shardCount prop covers uniform scaling via UpdateShardCount; merge/split give per-shard control). Provide the implementation with Effect.provide(AWS.Kinesis.MergeShardsHttp).

// init — bind the operation to the stream
const mergeShards = yield* AWS.Kinesis.MergeShards(stream);
// runtime — merge a shard with its adjacent neighbor
yield* mergeShards({
ShardToMerge: "shardId-000000000000",
AdjacentShardToMerge: "shardId-000000000001",
});