Skip to content

Commit e9bac56

Browse files
authored
Merge pull request #123 from clementcornut-skello/main
feat(Runtime): Allow nodejs24 runtime
2 parents 55dae93 + 9b1d327 commit e9bac56

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

lib/plugins/aws/custom-resources/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat
162162
});
163163
}
164164

165-
let runtimeVersion = 'nodejs22.x';
165+
let runtimeVersion = 'nodejs24.x';
166166
const providerRuntime = awsProvider.getRuntime();
167167
if (providerRuntime.startsWith('nodejs')) {
168168
runtimeVersion = providerRuntime;

lib/plugins/aws/provider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ class AwsProvider {
638638
'nodejs18.x',
639639
'nodejs20.x',
640640
'nodejs22.x',
641+
'nodejs24.x',
641642
'provided',
642643
'provided.al2',
643644
'provided.al2023',

test/unit/lib/plugins/aws/custom-resources/index.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe('#addCustomResourceToService()', () => {
349349
});
350350

351351
it('should use defined runtime', async () => {
352-
serverless.service.provider.runtime = 'nodejs22.x';
352+
serverless.service.provider.runtime = 'nodejs24.x';
353353
await Promise.all([
354354
// add the custom S3 resource
355355
addCustomResourceToService(provider, 's3', [
@@ -398,13 +398,13 @@ describe('#addCustomResourceToService()', () => {
398398

399399
expect(
400400
Resources.CustomDashresourceDashexistingDashs3LambdaFunction.Properties.Runtime
401-
).to.equal('nodejs22.x');
401+
).to.equal('nodejs24.x');
402402
expect(
403403
Resources.CustomDashresourceDashexistingDashcupLambdaFunction.Properties.Runtime
404-
).to.equal('nodejs22.x');
404+
).to.equal('nodejs24.x');
405405
expect(
406406
Resources.CustomDashresourceDasheventDashbridgeLambdaFunction.Properties.Runtime
407-
).to.equal('nodejs22.x');
407+
).to.equal('nodejs24.x');
408408
});
409409
});
410410

@@ -428,7 +428,7 @@ describe('test/unit/lib/plugins/aws/customResources/index.test.js', () => {
428428
expect(properties.FunctionName.endsWith('testing-custom-resource-apigw-cw-role')).to.be.true;
429429
});
430430

431-
it('falls back to nodejs22 runtime for CW custom resource if provider runtime is not nodejs ', async () => {
431+
it('falls back to nodejs24 runtime for CW custom resource if provider runtime is not nodejs ', async () => {
432432
const { cfTemplate } = await runServerless({
433433
fixture: 'api-gateway',
434434
command: 'package',
@@ -445,10 +445,10 @@ describe('test/unit/lib/plugins/aws/customResources/index.test.js', () => {
445445

446446
const properties =
447447
cfTemplate.Resources.CustomDashresourceDashapigwDashcwDashroleLambdaFunction.Properties;
448-
expect(properties.Runtime).to.equal('nodejs22.x');
448+
expect(properties.Runtime).to.equal('nodejs24.x');
449449
});
450450

451-
it('falls back to nodejs22 runtime for Cognito UP custom resource if provider runtime is not nodejs ', async () => {
451+
it('falls back to nodejs24 runtime for Cognito UP custom resource if provider runtime is not nodejs ', async () => {
452452
const { cfTemplate } = await runServerless({
453453
fixture: 'cognito-user-pool',
454454
command: 'package',
@@ -462,10 +462,10 @@ describe('test/unit/lib/plugins/aws/customResources/index.test.js', () => {
462462

463463
const properties =
464464
cfTemplate.Resources.CustomDashresourceDashexistingDashcupLambdaFunction.Properties;
465-
expect(properties.Runtime).to.equal('nodejs22.x');
465+
expect(properties.Runtime).to.equal('nodejs24.x');
466466
});
467467

468-
it('falls back to nodejs22 runtime for Event Bridge [LEGACY] custom resource if provider runtime is not nodejs ', async () => {
468+
it('falls back to nodejs24 runtime for Event Bridge [LEGACY] custom resource if provider runtime is not nodejs ', async () => {
469469
const { cfTemplate } = await runServerless({
470470
fixture: 'event-bridge',
471471
command: 'package',
@@ -483,10 +483,10 @@ describe('test/unit/lib/plugins/aws/customResources/index.test.js', () => {
483483

484484
const properties =
485485
cfTemplate.Resources.CustomDashresourceDasheventDashbridgeLambdaFunction.Properties;
486-
expect(properties.Runtime).to.equal('nodejs22.x');
486+
expect(properties.Runtime).to.equal('nodejs24.x');
487487
});
488488

489-
it('falls back to nodejs22 runtime for S3 custom resource if provider runtime is not nodejs ', async () => {
489+
it('falls back to nodejs24 runtime for S3 custom resource if provider runtime is not nodejs ', async () => {
490490
const { cfTemplate } = await runServerless({
491491
fixture: 's3',
492492
command: 'package',
@@ -500,7 +500,7 @@ describe('test/unit/lib/plugins/aws/customResources/index.test.js', () => {
500500

501501
const properties =
502502
cfTemplate.Resources.CustomDashresourceDashexistingDashs3LambdaFunction.Properties;
503-
expect(properties.Runtime).to.equal('nodejs22.x');
503+
expect(properties.Runtime).to.equal('nodejs24.x');
504504
});
505505

506506
it('correctly takes stage from config into account when constructing apiGatewayCloudWatchRole resource', async () => {

types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export type AwsLambdaRuntime =
6464
| "nodejs18.x"
6565
| "nodejs20.x"
6666
| "nodejs22.x"
67+
| "nodejs24.x"
6768
| "provided"
6869
| "provided.al2"
6970
| "provided.al2023"

0 commit comments

Comments
 (0)