You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lambda): allow retryAttempts = -1 for infinite retries in EventSourceMapping (#34009)
### Issue # (if applicable)
Fixes#34007
This PR addresses an inconsistency in the validation logic for the `retryAttempts` property of Lambda `EventSourceMapping`.
Previously, although the documentation indicated that `-1` signifies infinite retries (and is the default), explicitly setting `retryAttempts: -1` would cause a `ValidationError` because the validation logic enforced a lower bound of 0.
This change updates the validation in `aws-cdk-lib/aws-lambda/lib/event-source-mapping.ts` to correctly allow `-1` as a valid value, aligning the implementation with the documented behavior.
Additionally, this PR includes:
* Updates to the TSDoc for `retryAttempts` in `aws-cdk-lib/aws-lambda-event-sources/lib/stream.ts` to improve clarity regarding the valid range (`-1` or `0` to `10000`).
* Updates to the unit tests in `aws-cdk-lib/aws-lambda/test/event-source-mapping.test.ts` to verify the corrected behavior.
Affected modules: `aws-lambda`, `aws-lambda-event-sources`
### Reason for this change
### Description of changes
### Describe any new or updated permissions being added
### 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*
0 commit comments