Skip to content

Commit f19eb4d

Browse files
authored
Merge pull request #26 from lkeijmel/feature/sync-runtime-version-with-config
feat: add custom runtime support based on the defined runtime
2 parents c832eba + 5e026cf commit f19eb4d

File tree

50 files changed

+134
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+134
-69
lines changed

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

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

165+
let runtimeVersion = 'nodejs18.x';
166+
const providerRuntime = awsProvider.getRuntime();
167+
if (providerRuntime.startsWith('nodejs')) {
168+
runtimeVersion = providerRuntime;
169+
}
170+
165171
const customResourceFunction = {
166172
Type: 'AWS::Lambda::Function',
167173
Properties: {
@@ -172,7 +178,7 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat
172178
FunctionName: absoluteFunctionName,
173179
Handler,
174180
MemorySize: 1024,
175-
Runtime: 'nodejs18.x',
181+
Runtime: runtimeVersion,
176182
Timeout: 180,
177183
},
178184
DependsOn: [],

lib/plugins/aws/provider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ class AwsProvider {
18221822
}
18231823

18241824
getRuntime(runtime) {
1825-
const defaultRuntime = 'nodejs16.x';
1825+
const defaultRuntime = 'nodejs18.x';
18261826
const runtimeSourceValue = this.getRuntimeSourceValue();
18271827
return runtime || runtimeSourceValue.value || defaultRuntime;
18281828
}

lib/plugins/package/lib/package-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
},
3030

3131
getRuntime(runtime) {
32-
const defaultRuntime = 'nodejs16.x';
32+
const defaultRuntime = 'nodejs18.x';
3333
return runtime || this.serverless.service.provider.runtime || defaultRuntime;
3434
},
3535

test/fixtures/cli/variables/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ configValidationMode: error
33

44
provider:
55
name: aws
6-
runtime: nodejs16.x
6+
runtime: nodejs18.x
77

88
custom:
99
importedFile: ${file(config.json)}

test/fixtures/programmatic/api-gateway-extended/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ frameworkVersion: '*'
55

66
provider:
77
name: aws
8-
runtime: nodejs16.x
8+
runtime: nodejs18.x
99
versionFunctions: false
1010
apiGateway:
1111
shouldStartNameWithService: true

test/fixtures/programmatic/api-gateway/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ frameworkVersion: '*'
55

66
provider:
77
name: aws
8-
runtime: nodejs16.x
8+
runtime: nodejs18.x
99
apiGateway:
1010
shouldStartNameWithService: true
1111

test/fixtures/programmatic/check-for-changes/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ frameworkVersion: '*'
55

66
provider:
77
name: aws
8-
runtime: nodejs16.x
8+
runtime: nodejs18.x
99

1010
functions:
1111
fn1:

test/fixtures/programmatic/cognito-user-pool/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ configValidationMode: error
44

55
provider:
66
name: aws
7-
runtime: nodejs16.x
7+
runtime: nodejs18.x
88
versionFunctions: false
99

1010
functions:

test/fixtures/programmatic/config-schema-extensions-error/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ service: configSchemaExtensionsError
22

33
provider:
44
name: someProvider
5-
runtime: nodejs16.x
5+
runtime: nodejs18.x
66

77
configValidationMode: error
88
frameworkVersion: '*'

test/fixtures/programmatic/curated-plugins/serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ custom:
1010

1111
provider:
1212
name: aws
13-
runtime: nodejs16.x
13+
runtime: nodejs18.x
1414

1515
functions:
1616
function:

0 commit comments

Comments
 (0)