-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(lambda): use nodejs22.x as default runtime #34117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Deprecate NODE_LATEST in favor of determineLatestNodeRuntime(). - Fix misleading description of `@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion` feature flag. - Mark nodejs18.x as deprecated (it's no longer in maintenance upstream, folks should upgrade) Nodejs18 is no longer in maintenance: https://nodejs.org/en/about/previous-releases and will be deprecated by AWS on 2025 September 1 https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html NODE_LATEST still points to v18: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts#L119 I see that there's been an issue about this since 2023: aws#28125 The feature flag? `@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion` https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts#L182 As written, gives you NODE_LATEST (v18) by default instead of v16. The best practice seems to be to use determineLatestNodeRuntime() https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts#L414, But even that can default to v18.
There was a problem hiding this 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)
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Unsurprisingly, this changes snapshots for 11 "unrelated" test suites. Before I invest more time in this, I would like to get a commitment around having this merged. |
We need this as our company need the latest support of nodejs |
This is very odd to use latest as a deprecated version? Can we move this to something that is representative of what the upstream nodejs project is listing as a usable version? |
@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion
feature flag.Nodejs18 is no longer in maintenance: https://nodejs.org/en/about/previous-releases
and will be deprecated by AWS on 2025 September 1 https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
NODE_LATEST still points to v18:
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts#L119
I see that there's been an issue about this since 2023: #28125
The feature flag?
@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts#L182
As written, gives you NODE_LATEST (v18) by default instead of v16.
The best practice seems to be to use determineLatestNodeRuntime()
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts#L414,
But even that can default to v18.
Issue # (if applicable)
Closes #28125
Reason for this change
I just wasted a bunch of time assuming that NODEJS_LATEST meant what it implied.
More time assuming that "useLatestRuntimeVersion" did what it said.
Description of changes
See above.
Describe any new or updated permissions being added
None.
Description of how you validated changes
Existing tests updated with new defaults.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license