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
8 changes: 7 additions & 1 deletion lib/plugins/aws/custom-resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat
});
}

let runtimeVersion = 'nodejs18.x';
const providerRuntime = awsProvider.getRuntime();
if (providerRuntime.startsWith('nodejs')) {
runtimeVersion = providerRuntime;
}

const customResourceFunction = {
Type: 'AWS::Lambda::Function',
Properties: {
Expand All @@ -172,7 +178,7 @@ async function addCustomResourceToService(awsProvider, resourceName, iamRoleStat
FunctionName: absoluteFunctionName,
Handler,
MemorySize: 1024,
Runtime: 'nodejs18.x',
Runtime: runtimeVersion,
Timeout: 180,
},
DependsOn: [],
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/aws/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ class AwsProvider {
}

getRuntime(runtime) {
const defaultRuntime = 'nodejs16.x';
const defaultRuntime = 'nodejs18.x';
const runtimeSourceValue = this.getRuntimeSourceValue();
return runtime || runtimeSourceValue.value || defaultRuntime;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/package/lib/package-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
},

getRuntime(runtime) {
const defaultRuntime = 'nodejs16.x';
const defaultRuntime = 'nodejs18.x';
return runtime || this.serverless.service.provider.runtime || defaultRuntime;
},

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/cli/variables/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

custom:
importedFile: ${file(config.json)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false
apiGateway:
shouldStartNameWithService: true
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/api-gateway/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
apiGateway:
shouldStartNameWithService: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
fn1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: configSchemaExtensionsError

provider:
name: someProvider
runtime: nodejs16.x
runtime: nodejs18.x

configValidationMode: error
frameworkVersion: '*'
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/curated-plugins/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ custom:

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
function:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/ecr/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
ecr:
images:
baseimage:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/event-bridge/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
foo:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/function-efs/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/function-layers/serverless.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
service: service
provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

layers:
testLayer:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/function-msk/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/function/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
basic:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
foo:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/http-api-export/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

resources:
Resources:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/http-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
logRetentionInDays: 14

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/invocation/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
callback:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/iot/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/layer/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
function:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

custom:
env: ${env:ENV_SOURCE_TEST, null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

plugins:
# Mutates `package.artifact` to point to copied `.serverless/NAME.zip`
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/package-artifact/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

package:
artifact: artifact.zip
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/packaging/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ disabledDeprecations: LOAD_VARIABLES_FROM_ENV_FILES

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
fnService:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/plugin/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ frameworkVersion: '*'

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

plugins:
- ./plugin
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: service

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

functions:
target:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/request-schema/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: service

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
apiGateway:
request:
schemas:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/s3/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false
s3:
customBucket:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/schedule/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/sns/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/sqs/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/stream/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/variables-legacy/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: service

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x

custom:
importedFile: ${file(config.json)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false

functions:
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/programmatic/websocket/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configValidationMode: error

provider:
name: aws
runtime: nodejs16.x
runtime: nodejs18.x
versionFunctions: false
logs:
websocket: true
Expand Down
Loading