feat(lambda): add SQS provisionedPollerConfig support with validation and fix type mismatch#37550
Open
badmintoncryer wants to merge 13 commits intoaws:mainfrom
Open
Conversation
…ate JSDoc minimumPollers and maximumPollers were declared as required in stream.ts but optional in event-source-mapping.ts, causing a type mismatch. Also adds SQS vs MSK/Kafka range and default differences to JSDoc.
aws-cdk-automation
previously requested changes
Apr 8, 2026
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
…and tests - Add provisionedPollerConfig to SqsEventSourceProps with SQS-specific validation (minimumPollers: 2-200, maximumPollers: 2-2000) - Fix minimumPollers/maximumPollers in stream.ts to be optional and add Valid Range JSDoc - Update event-source-mapping.ts JSDoc to document SQS vs MSK differences - Add 6 unit tests for SQS provisionedPollerConfig validation
…min/max to error message
…sioned poller validation
aws-cdk-automation
previously requested changes
Apr 8, 2026
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Contributor
|
|
||||||||||||||||||
Contributor
|
|
||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue # (if applicable)
Follow-up to #37197 (see lpizzinidev's review comment).
Reason for this change
In #37197,
lpizzinidevpointed out two issues:minimumPollersandmaximumPollersinstream.tswere declared as required, while the definition inevent-source-mapping.tshas them as optional — a type mismatch.Additionally,
SqsEventSourcedid not supportprovisionedPollerConfigat all, and SQS has stricter limits than MSK/Kafka (minimum value of 2 vs 1).Description of changes
aws-lambda-event-sources/lib/stream.ts: ChangedminimumPollersandmaximumPollersfrom required to optional to matchevent-source-mapping.ts. Added Valid Range to JSDoc and a@seelink.aws-lambda/lib/event-source-mapping.ts: Updated JSDoc for both properties to document service-specific valid ranges and defaults (SQS: min 2–200 default 2, max 2–2000 default 200 / MSK/Kafka/MQ: min 1–200 default 1, max 1–2000 default 200).aws-lambda-event-sources/lib/sqs.ts: AddedprovisionedPollerConfigtoSqsEventSourcePropswith SQS-specific validation (min: 2–200, max: 2–2000) and wired it through toEventSourceMapping.Describe any new or updated permissions being added
None.
Description of how you validated changes
Added unit tests for all new validation paths.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license