You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added --prebuiltDirectory
* Use rsync to copy necessary files before archiving
* Read package.json's name only if it exists
When using webpack, we may have one npm package and multiple lambda
functions sharing code. Lambda functions don't necessarily have a
package.json in them.
* Bug fix. All tests pass now.
-x, --excludeGlobs [] Add a space separated list of file(type)s to ignore (e.g. "*.json .env")
92
+
-P, --prebuiltDirectory [] Prebuilt directory
93
+
92
94
```
93
95
94
96
#### deploy
@@ -114,22 +116,23 @@ $ node-lambda deploy --help
114
116
-m, --memorySize [128] Lambda Memory Size
115
117
-t, --timeout [3] Lambda Timeout
116
118
-d, --description [missing] Lambda Description
117
-
-u, --runtime [nodejs4.3] Lambda Runtime {nodejs4.3, nodejs} - "nodejs4.3" is the current standard, "nodejs" is v0.10.36
119
+
-u, --runtime [nodejs4.3] Lambda Runtime {nodejs4.3, nodejs} - "nodejs4.3" is the current standard, "nodejs" is v0.10.36
118
120
-p, --publish [false] This boolean parameter can be used to request AWS Lambda to create the Lambda function and publish a version as an atomic operation
-b, --vpcSubnets [] VPC Subnet ID(s, comma separated list) for your Lambda Function, when using this, the below param is also required
122
124
-g, --vpcSecurityGroups [] VPC Security Group ID(s, comma separated list) for your Lambda Function, when using this, the above param is also required
123
125
-x, --excludeGlobs [] Add a space separated list of file(type)s to ignore (e.g. "*.json .env")
126
+
-P, --prebuiltDirectory [] Prebuilt directory
124
127
```
125
128
126
129
## Custom Environment Variables
127
130
128
-
AWS Lambda doesn't let you set environment variables for your function, but in many cases you will need to configure your function with secure values that you don't want to check into version control, for example a DB connection string or encryption key. Use the sample `deploy.env` file in combination with the `--configFile` flag to set values which will be prepended to your compiled Lambda function as `process.env` environment variables before it gets uploaded to S3.
131
+
AWS Lambda doesn't let you set environment variables for your function, but in many cases you will need to configure your function with secure values that you don't want to check into version control, for example a DB connection string or encryption key. Use the sample `deploy.env` file in combination with the `--configFile` flag to set values which will be prepended to your compiled Lambda function as `process.env` environment variables before it gets uploaded to S3.
129
132
130
133
## Node.js Runtime Configuration
131
134
132
-
AWS Lambda now supports Node.js v4.3.2, and there have been some [API changes](http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html) for the new version. Most notably,
135
+
AWS Lambda now supports Node.js v4.3.2, and there have been some [API changes](http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html) for the new version. Most notably,
133
136
`context.done()`, `context.succeed()`, and `context.fail()` are deprecated in favor of the Node convention of passing in
134
137
a callback function. These will still work for now for backward compatibility, but are no longer recommended.
135
138
@@ -138,6 +141,12 @@ v0.10.36 is still supported, and can be targeted by changing the `AWS_RUNTIME` v
138
141
## Post install script
139
142
When running `node-lambda deploy` if you need to do some action after `npm install --production` and before deploying to AWS Lambda (i.e. replace some modules with precompiled ones or download some libraries) 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. Make sure that the script is executable.
140
143
144
+
## Prebuilt packages
145
+
The `--prebuiltDirectory` flag is useful for working with Webpack for example. It skips `npm install --production` and `post_install.sh` and simply packages the specified directory.
146
+
147
+
## Handling `npm link` and Dependencies With Local Paths
148
+
Perhaps the easiest way to handle these cases is to bundle the code using Webpack and use the `--prebuiltDirectory` flag to package the output for deployment.
0 commit comments