Describe the bug
There's an inconsistency in the AWS CDK Kinesis event source mapping validation. According to the documentation, -1 is the default value for retryAttempts which should set retries to infinite. However, when explicitly setting this value to -1, validation fails with:
ValidationError: retryAttempts must be between 0 and 10000 inclusive, got -1
at path [X] in aws-cdk-lib.aws_lambda.EventSourceMapping
Documentation Reference

Steps to Reproduce
new KinesisEventSource(telemetryStream, {
startingPosition: StartingPosition.LATEST,
batchSize: 10000,
maxBatchingWindow: Duration.seconds(30),
parallelizationFactor: 1,
retryAttempts: -1, // This fails validation
reportBatchItemFailures: false,
bisectBatchOnError: false
});
Expected Behavior
Since -1 is documented as the default value that sets retries to infinite, it should be accepted by the validation.
Actual Behavior
Validation fails with: retryAttempts must be between 0 and 10000 inclusive, got -1
Workaround
The only current workaround is to omit the retryAttempts property entirely to use the default, or set it to a value between 0 and 10000.
CDK CLI Version
2.1006.0
Framework Version
No response
Node.js Version
22.14.0
OS
Ubuntu 24.04
Language
TypeScript
Language Version
No response
Other information
No response
Describe the bug
There's an inconsistency in the AWS CDK Kinesis event source mapping validation. According to the documentation,
-1is the default value forretryAttemptswhich should set retries to infinite. However, when explicitly setting this value to-1, validation fails with:Documentation Reference
Steps to Reproduce
Expected Behavior
Since
-1is documented as the default value that sets retries to infinite, it should be accepted by the validation.Actual Behavior
Validation fails with:
retryAttempts must be between 0 and 10000 inclusive, got -1Workaround
The only current workaround is to omit the
retryAttemptsproperty entirely to use the default, or set it to a value between 0 and 10000.CDK CLI Version
2.1006.0
Framework Version
No response
Node.js Version
22.14.0
OS
Ubuntu 24.04
Language
TypeScript
Language Version
No response
Other information
No response