Skip to content

Commit

Permalink
Add nodejs12.x to runtime (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
abetomo authored and DeviaVir committed Dec 5, 2019
1 parent 47cfa22 commit 63c84c0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ AWS_MEMORY_SIZE // (default: 128)
AWS_TIMEOUT // (default: 60)
AWS_RUN_TIMEOUT // (default: 3)
AWS_DESCRIPTION // (default: package.json.description or '')
AWS_RUNTIME // (default: 'nodejs10.x')
AWS_RUNTIME // (default: 'nodejs12.x')
AWS_PUBLISH // (default: false)
AWS_FUNCTION_VERSION // (default: '')
AWS_VPC_SUBNETS // (default: '')
Expand Down Expand Up @@ -116,7 +116,7 @@ Options:
-h, --help output usage information
-H, --handler [index.handler] Lambda Handler {index.handler}
-j, --eventFile [event.json] Event JSON File
-u, --runtime [nodejs10.x] Lambda Runtime
-u, --runtime [nodejs12.x] Lambda Runtime
-t, --timeout [3] Lambda Timeout
-f, --configFile [] Path to file holding secret environment variables (e.g. "deploy.env")
-x, --contextFile [context.json] Context JSON File
Expand Down Expand Up @@ -176,7 +176,7 @@ Options:
-m, --memorySize [128] Lambda Memory Size
-t, --timeout [3] Lambda Timeout
-d, --description [missing] Lambda Description
-u, --runtime [nodejs10.x] Lambda Runtime
-u, --runtime [nodejs12.x] Lambda Runtime
-p, --publish [false] Lambda Publish
-L, --lambdaVersion [] Lambda Function Version
-b, --vpcSubnets [] Lambda Function VPC Subnets
Expand Down Expand Up @@ -210,7 +210,7 @@ AWS Lambda will let you set environment variables for your function. Use the sam

## Node.js Runtime Configuration

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.
AWS Lambda now supports Node.js 12, Node.js 10 and Node.js 8.10. Please also check the [Programming Model (Node.js)](http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html) page.

## Post install script
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.
Expand Down
2 changes: 1 addition & 1 deletion bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AWS_MEMORY_SIZE = process.env.AWS_MEMORY_SIZE || 128
const AWS_TIMEOUT = process.env.AWS_TIMEOUT || 60
const AWS_RUN_TIMEOUT = process.env.AWS_RUN_TIMEOUT || 3
const AWS_DESCRIPTION = process.env.AWS_DESCRIPTION || packageJson.description || ''
const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs10.x'
const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs12.x'
const AWS_PUBLISH = process.env.AWS_PUBLISH || false
const AWS_FUNCTION_VERSION = process.env.AWS_FUNCTION_VERSION || ''
const AWS_VPC_SUBNETS = process.env.AWS_VPC_SUBNETS || ''
Expand Down
2 changes: 1 addition & 1 deletion lib/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AWS_HANDLER=index.handler
AWS_MEMORY_SIZE=128
AWS_TIMEOUT=3
AWS_DESCRIPTION=
AWS_RUNTIME=nodejs10.x
AWS_RUNTIME=nodejs12.x
AWS_VPC_SUBNETS=
AWS_VPC_SECURITY_GROUPS=
AWS_TRACING_CONFIG=
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ event_sources.json and ${program.eventFile} files as needed.`)
}

run (program) {
if (!['nodejs8.10', 'nodejs10.x'].includes(program.runtime)) {
if (!['nodejs8.10', 'nodejs10.x', 'nodejs12.x'].includes(program.runtime)) {
console.error(`Runtime [${program.runtime}] is not supported.`)
process.exit(254)
}
Expand Down
2 changes: 1 addition & 1 deletion test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const originalProgram = {
memorySize: 128,
timeout: 3,
description: '',
runtime: 'nodejs10.x',
runtime: 'nodejs12.x',
deadLetterConfigTargetArn: '',
tracingConfig: '',
Layers: '',
Expand Down
2 changes: 1 addition & 1 deletion test/node-lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('bin/node-lambda', () => {
process.env.AWS_RUNTIME = 'test'
})
after(() => {
process.env.AWS_RUNTIME = 'nodejs10.x'
process.env.AWS_RUNTIME = 'nodejs12.x'
})

it('`node-lambda run` exitCode is `254` (callback(null))', (done) => {
Expand Down

0 comments on commit 63c84c0

Please sign in to comment.