Skip to content

Commit

Permalink
docs(lambda-event-source): improve docstring in KinesisEventSourcePro…
Browse files Browse the repository at this point in the history
…ps (#29582)

### Issue # (if applicable)

Closes #27321

### Reason for this change

Our customer found `maxRecordAge`  can't be set to `-1` Due to limitation of `cdk.Duration`. However, it's not obvious in the docstring that the [default value](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumrecordageinseconds) of `maxRecordAge` is already -1. Our customer can simply leave this prop empty to set it to -1. 

So, This PR improves the docstring to make default value more apparent.

See more discussion in the ticket.

### Description of changes

Improve docstring of `maxRecordAge` and `retryAttempts` in `KinesisEventSourceProps` in `aws-lambda-event-source`

### Description of how you validated changes



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
roger-zhangg authored Mar 27, 2024
1 parent 4dbf5c8 commit bba099a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps {
* * Minimum value of 60 seconds
* * Maximum value of 7 days
*
* @default - the retention period configured on the stream
* The default value is -1, which sets the maximum age to infinite.
* When the value is set to infinite, Lambda never discards old records.
* Record are valid until it expires in the event source.
*
* @default -1
*/
readonly maxRecordAge?: Duration;

Expand All @@ -73,7 +77,11 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps {
* * Minimum value of 0
* * Maximum value of 10000
*
* @default - retry until the record expires
* The default value is -1, which sets the maximum number of retries to infinite.
* When MaximumRetryAttempts is infinite, Lambda retries failed records until
* the record expires in the event source.
*
* @default -1
*/
readonly retryAttempts?: number;

Expand Down

0 comments on commit bba099a

Please sign in to comment.