-
-
Notifications
You must be signed in to change notification settings - Fork 56
update hardcoded node18.x runtime to node20.x #58
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
lib/plugins/aws/provider.js
Outdated
|
|
||
| getRuntime(runtime) { | ||
| const defaultRuntime = 'nodejs18.x'; | ||
| const defaultRuntime = 'nodejs20.x'; |
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 is a breaking change to the default.
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.
I made a new commit to revert that change, but upon further inspection, line 166 of custom-resources/index.js (
| const providerRuntime = awsProvider.getRuntime(); |
If I revert that change, then this PR is not that useful... we'll still get a deprecation warning related to the custom-resource-apigw-cw-role lambda.
Could you indicate why it is a breaking change? I have no problem looking into it and see if we can update it properly.
|
We should update the examples, but not change the default IMO. |
GrahamCampbell
left a comment
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.
Can you revert all the places where the default was changed please. I commented on just one, but there's at least one other.
| } | ||
|
|
||
| let runtimeVersion = 'nodejs18.x'; | ||
| let runtimeVersion = 'nodejs20.x'; |
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.
revert
|
|
||
| getRuntime(runtime) { | ||
| const defaultRuntime = 'nodejs18.x'; | ||
| const defaultRuntime = 'nodejs20.x'; |
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.
revert
Please see the reply I left in your first comment. If I revert the change in AwsProvider, then we won't solve the underlying problem about the runtime deprecation. |
|
The deprecation message is not an error, it's just a deprecation. We have plenty of time before we need to actually stop using v18. I'd probably prefer we actually skipped v20, going straight for v22, so we only change the default every 2 years. |
That makes sense to me. Is the jump to v22 as easy as just replacing the default runtime, or it's more complicated than that? |
|
Yes. v20 and v22 are similar to upgrade to. |
Problem
AWS will deprecate the nodejs18.x runtime starting April 30, 2025. It has already starting notifying account about this change:
When using the serverless framework to deploy a project, a "custom-resource-apigw-cw-role" lambda gets created. The runtime of this lambda is hardcoded in
lib/plugins/aws/custom-resources/index.jsand it can't be changed or configured through the main serverless.yml configuration file (see serverless/serverless#12307 as a reference).Solution
This PR updates all the hardcoded runtime versions to nodejs20.x in order to avoid the deprecation warning.