Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Add nodejs12.x as a possible runtime #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions serverless.js
Original file line number Diff line number Diff line change
@@ -65,9 +65,9 @@ class Backend extends Component {
}

// Check if the runtime is allowed
if (inputs.runtime && !['nodejs8.10', 'nodejs10.x'].includes(inputs.runtime)) {
if (inputs.runtime && !['nodejs8.10', 'nodejs10.x', 'nodejs12.x'].includes(inputs.runtime)) {
throw new Error(
`The runtime can only be 'nodejs8.10' or 'nodejs10.x'. Runtime specified: ${inputs.runtime}`
`The runtime can only be 'nodejs8.10', 'nodejs10.x' or 'nodejs12.x'. Runtime specified: ${inputs.runtime}`
)
}

@@ -100,7 +100,7 @@ class Backend extends Component {
description: inputs.description || 'A function for the Backend Component',
memory: inputs.memory || 896,
timeout: inputs.timeout || 10,
runtime: inputs.runtime || 'nodejs10.x',
runtime: inputs.runtime || 'nodejs12.x',
code: inputs.code.src || inputs.code.root,
role: roleOutputs,
handler: 'shim.handler',
35 changes: 13 additions & 22 deletions serverless.types.js
Original file line number Diff line number Diff line change
@@ -8,12 +8,10 @@ module.exports = {
name: 'code',
type: 'code',
required: true,
description: 'The directory which contains your backend code, declared by an index.js file',
defaultRuntime: 'nodejs10.x',
runtimes: [
'nodejs10.x',
'nodejs8.10',
]
description:
'The directory which contains your backend code, declared by an index.js file',
defaultRuntime: 'nodejs12.x',
runtimes: ['nodejs12.x', 'nodejs10.x', 'nodejs8.10']
},
{
name: 'region',
@@ -43,7 +41,7 @@ module.exports = {
'eu-north-1',
'sa-east-1',
'us-gov-east-1',
'us-gov-west-1',
'us-gov-west-1'
]
},
{
@@ -56,25 +54,18 @@ module.exports = {
name: 'memory',
type: 'value',
valueType: 'number',
description: 'The memory size of the AWS Lambda function running the back-end code. Increased memory size will result in faster performance, reduced cold-start times, but also higher cost',
description:
'The memory size of the AWS Lambda function running the back-end code. Increased memory size will result in faster performance, reduced cold-start times, but also higher cost',
required: true,
default: 896,
options: [
128,
384,
512,
896,
1280,
2048,
2560,
3008,
]
options: [128, 384, 512, 896, 1280, 2048, 2560, 3008]
},
{
name: 'timeout',
type: 'value',
valueType: 'number',
description: 'The number of seconds which the AWS Lambda function running the back-end code can run for',
description:
'The number of seconds which the AWS Lambda function running the back-end code can run for',
required: true,
default: 9,
options: [
@@ -116,10 +107,10 @@ module.exports = {
8000,
10000,
12000,
15000,
15000
]
},
],
}
]
},
remove: {
description: 'Removes this instance of this component',