Skip to content

aws-kinesis: support maximum record size on Stream #38719

Description

@badmintoncryer

Describe the feature

MaxRecordSizeInKiB is supported by the underlying L1 AWS::Kinesis::Stream but missing from the L2 StreamProps in aws-cdk-lib/aws-kinesis.

Kinesis Data Streams raised the maximum size of a single record from 1 MiB to 10 MiB in October 2025.

Use Case

Workloads that intermittently emit payloads larger than 1 MiB (IoT telemetry batches, CDC records, generative AI payloads) no longer need to split records across a side channel. Configuring this from CDK currently requires an escape hatch:

const stream = new kinesis.Stream(this, 'MyStream');
(stream.node.defaultChild as kinesis.CfnStream).maxRecordSizeInKiB = 10240;

Proposed Solution

Add optional maxRecordSize?: Size to StreamProps and pass it through to the L1 MaxRecordSizeInKiB.

new kinesis.Stream(this, 'MyLargeRecordStream', {
  maxRecordSize: Size.mebibytes(10),
});

Size rather than a raw number, so the unit is carried by the type. Same as ephemeralStorageSize in aws-lambda and provisionedThroughputPerSecond in aws-efs.

Other Information

WarmThroughputMiBps is also missing from this L2. Different constraints, so I will raise it separately.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

2.267.0

AWS CDK CLI version

2.1131.0 (build 1e9a1e1)

Node.js Version

v20.19.2

OS

macOS 14.6.1

Language

TypeScript

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-kinesisRelated to Amazon Kinesiseffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions