Skip to content

feat(lambda): add SQS provisionedPollerConfig support with validation and fix type mismatch#37550

Open
badmintoncryer wants to merge 13 commits intoaws:mainfrom
badmintoncryer:fix/provisioned-poller-config-types-and-docs
Open

feat(lambda): add SQS provisionedPollerConfig support with validation and fix type mismatch#37550
badmintoncryer wants to merge 13 commits intoaws:mainfrom
badmintoncryer:fix/provisioned-poller-config-types-and-docs

Conversation

@badmintoncryer
Copy link
Copy Markdown
Contributor

@badmintoncryer badmintoncryer commented Apr 8, 2026

Issue # (if applicable)

Follow-up to #37197 (see lpizzinidev's review comment).

Reason for this change

In #37197, lpizzinidev pointed out two issues:

  1. minimumPollers and maximumPollers in stream.ts were declared as required, while the definition in event-source-mapping.ts has them as optional — a type mismatch.
  2. The JSDoc for these properties did not document the differences in allowed ranges and default values between Amazon SQS and Amazon MSK / self-managed Kafka / Amazon MQ.

Additionally, SqsEventSource did not support provisionedPollerConfig at 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: Changed minimumPollers and maximumPollers from required to optional to match event-source-mapping.ts. Added Valid Range to JSDoc and a @see link.
  • 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: Added provisionedPollerConfig to SqsEventSourceProps with SQS-specific validation (min: 2–200, max: 2–2000) and wired it through to EventSourceMapping.

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

…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.
@github-actions github-actions bot added the p2 label Apr 8, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 8, 2026 13:36
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@badmintoncryer badmintoncryer changed the title fix(lambda): make ProvisionedPollerConfig properties optional and update JSDoc chore(lambda): make ProvisionedPollerConfig properties optional and update JSDoc Apr 8, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 8, 2026 13:40

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@badmintoncryer badmintoncryer marked this pull request as draft April 8, 2026 14:43
…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
@badmintoncryer badmintoncryer marked this pull request as ready for review April 8, 2026 15:13
@badmintoncryer badmintoncryer changed the title chore(lambda): make ProvisionedPollerConfig properties optional and update JSDoc fix(lambda): add SQS provisionedPollerConfig support with validation and fix type mismatch Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@badmintoncryer badmintoncryer changed the title fix(lambda): add SQS provisionedPollerConfig support with validation and fix type mismatch feat(lambda): add SQS provisionedPollerConfig support with validation and fix type mismatch Apr 9, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 9, 2026 15:12

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ☑️SkippedFailed ❌️
Security Guardian Results48 ran47 passed1 failed
TestResult
Security Guardian Results
packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.sqs-with-poller-config.js.snapshot/lambda-event-source-sqs-with-poller-config.template.json
sqs-encryption-enabled.guard❌ failure

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ☑️SkippedFailed ❌️
Security Guardian Results with resolved templates48 ran47 passed1 failed
TestResult
Security Guardian Results with resolved templates
packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.sqs-with-poller-config.js.snapshot/lambda-event-source-sqs-with-poller-config.template.json
sqs-encryption-enabled.guard❌ failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants