Skip to content

Commit 106d0b6

Browse files
abetomoDeviaVir
authored andcommitted
Support Node.js 10.x (#487)
* Support Node.js 10.x AWS Lambda adds support for Node.js v10 https://aws.amazon.com/jp/about-aws/whats-new/2019/05/aws_lambda_adds_support_for_node_js_v10/ * Upgrade packages For nodejs 10.x supporting sdk from 2.437.0. https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html
1 parent 89af573 commit 106d0b6

File tree

9 files changed

+245
-1638
lines changed

9 files changed

+245
-1638
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ AWS_MEMORY_SIZE // (default: 128)
7878
AWS_TIMEOUT // (default: 60)
7979
AWS_RUN_TIMEOUT // (default: 3)
8080
AWS_DESCRIPTION // (default: package.json.description or '')
81-
AWS_RUNTIME // (default: 'nodejs8.10')
81+
AWS_RUNTIME // (default: 'nodejs10.x')
8282
AWS_PUBLISH // (default: false)
8383
AWS_FUNCTION_VERSION // (default: '')
8484
AWS_VPC_SUBNETS // (default: '')
@@ -114,7 +114,7 @@ Options:
114114
-h, --help output usage information
115115
-H, --handler [index.handler] Lambda Handler {index.handler}
116116
-j, --eventFile [event.json] Event JSON File
117-
-u, --runtime [nodejs8.10] Lambda Runtime
117+
-u, --runtime [nodejs10.x] Lambda Runtime
118118
-t, --timeout [3] Lambda Timeout
119119
-f, --configFile [] Path to file holding secret environment variables (e.g. "deploy.env")
120120
-x, --contextFile [context.json] Context JSON File
@@ -174,7 +174,7 @@ Options:
174174
-m, --memorySize [128] Lambda Memory Size
175175
-t, --timeout [3] Lambda Timeout
176176
-d, --description [missing] Lambda Description
177-
-u, --runtime [nodejs8.10] Lambda Runtime
177+
-u, --runtime [nodejs10.x] Lambda Runtime
178178
-p, --publish [false] Lambda Publish
179179
-L, --lambdaVersion [] Lambda Function Version
180180
-b, --vpcSubnets [] Lambda Function VPC Subnets
@@ -208,7 +208,7 @@ AWS Lambda will let you set environment variables for your function. Use the sam
208208

209209
## Node.js Runtime Configuration
210210

211-
AWS Lambda now supports Node.js 8.10 and Node.js 6.10. Please also check the [Programming Model (Node.js)](http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html) page.
211+
AWS Lambda now supports Node.js 10, Node.js 8.10 and Node.js 6.10. Please also check the [Programming Model (Node.js)](http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html) page.
212212

213213
## Post install script
214214
When running `node-lambda deploy` if you need to do some action after `npm install --production` and before deploying to AWS Lambda (e.g. replace some modules with precompiled ones or download some libraries, replace some config file depending on environment) you can create `post_install.sh` script. If the file exists the script will be executed (and output shown after execution) if not it is skipped. Environment string is passed to script as first parameter so you can use it if needed. Make sure that the script is executable.

bin/node-lambda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const AWS_MEMORY_SIZE = process.env.AWS_MEMORY_SIZE || 128
3131
const AWS_TIMEOUT = process.env.AWS_TIMEOUT || 60
3232
const AWS_RUN_TIMEOUT = process.env.AWS_RUN_TIMEOUT || 3
3333
const AWS_DESCRIPTION = process.env.AWS_DESCRIPTION || packageJson.description || ''
34-
const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs8.10'
34+
const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs10.x'
3535
const AWS_PUBLISH = process.env.AWS_PUBLISH || false
3636
const AWS_FUNCTION_VERSION = process.env.AWS_FUNCTION_VERSION || ''
3737
const AWS_VPC_SUBNETS = process.env.AWS_VPC_SUBNETS || ''

lib/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AWS_HANDLER=index.handler
1010
AWS_MEMORY_SIZE=128
1111
AWS_TIMEOUT=3
1212
AWS_DESCRIPTION=
13-
AWS_RUNTIME=nodejs6.10
13+
AWS_RUNTIME=nodejs10.x
1414
AWS_VPC_SUBNETS=
1515
AWS_VPC_SECURITY_GROUPS=
1616
AWS_TRACING_CONFIG=

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ event_sources.json and ${program.eventFile} files as needed.`)
5151
}
5252

5353
run (program) {
54-
if (!['nodejs6.10', 'nodejs8.10'].includes(program.runtime)) {
54+
if (!['nodejs6.10', 'nodejs8.10', 'nodejs10.x'].includes(program.runtime)) {
5555
console.error(`Runtime [${program.runtime}] is not supported.`)
5656
process.exit(254)
5757
}

0 commit comments

Comments
 (0)