-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
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? |
We are unable to move the default from 18 currently until 20 or 22 is supported in all regions by Lambda. See #33626 |
This PR has been in the BUILD FAILING state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Comments on closed issues and PRs are hard for our team to see. |
@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