Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/plugins/aws/custom-resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat
});
}

let runtimeVersion = 'nodejs22.x';
let runtimeVersion = 'nodejs24.x';
const providerRuntime = awsProvider.getRuntime();
if (providerRuntime.startsWith('nodejs')) {
runtimeVersion = providerRuntime;
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/aws/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ class AwsProvider {
'nodejs18.x',
'nodejs20.x',
'nodejs22.x',
'nodejs24.x',
'provided',
'provided.al2',
'provided.al2023',
Expand Down
24 changes: 12 additions & 12 deletions test/unit/lib/plugins/aws/custom-resources/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ describe('#addCustomResourceToService()', () => {
});

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

expect(
Resources.CustomDashresourceDashexistingDashs3LambdaFunction.Properties.Runtime
).to.equal('nodejs22.x');
).to.equal('nodejs24.x');
expect(
Resources.CustomDashresourceDashexistingDashcupLambdaFunction.Properties.Runtime
).to.equal('nodejs22.x');
).to.equal('nodejs24.x');
expect(
Resources.CustomDashresourceDasheventDashbridgeLambdaFunction.Properties.Runtime
).to.equal('nodejs22.x');
).to.equal('nodejs24.x');
});
});

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

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

const properties =
cfTemplate.Resources.CustomDashresourceDashapigwDashcwDashroleLambdaFunction.Properties;
expect(properties.Runtime).to.equal('nodejs22.x');
expect(properties.Runtime).to.equal('nodejs24.x');
});

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

const properties =
cfTemplate.Resources.CustomDashresourceDashexistingDashcupLambdaFunction.Properties;
expect(properties.Runtime).to.equal('nodejs22.x');
expect(properties.Runtime).to.equal('nodejs24.x');
});

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

const properties =
cfTemplate.Resources.CustomDashresourceDasheventDashbridgeLambdaFunction.Properties;
expect(properties.Runtime).to.equal('nodejs22.x');
expect(properties.Runtime).to.equal('nodejs24.x');
});

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

const properties =
cfTemplate.Resources.CustomDashresourceDashexistingDashs3LambdaFunction.Properties;
expect(properties.Runtime).to.equal('nodejs22.x');
expect(properties.Runtime).to.equal('nodejs24.x');
});

it('correctly takes stage from config into account when constructing apiGatewayCloudWatchRole resource', async () => {
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export type AwsLambdaRuntime =
| "nodejs18.x"
| "nodejs20.x"
| "nodejs22.x"
| "nodejs24.x"
| "provided"
| "provided.al2"
| "provided.al2023"
Expand Down