Tracked
- NPM Downloads Last Month
- 97
- Issues
- 0
- Stars
- 0
- Forks
- 0
- Watchers
- 0
This plugin was originally built to allow deployment of arbitrarily nested python lambdas using serverless. The functionality is related to the one discussed in this serverless issue (#3366).
Vanilla serverless packages your source-code, but retains the folder structure inside the zip-file. However, AWS Lambda can only find the entry-point to your function if it is packaged in a zip-files at root level (see the AWS-Lambda docs).
You define a path
that you want to package inside of serverless’s package
property. The plugin then packages your code, such that te defined path becomes the root-path (.
) of the package zip-file.
artifact
property. The zip-file will be placed there.include_globs
property.libs
property. The contents of this folder will be packaged alongside your functions code (in the root of the zip-file). This lets you include arbitrary python modules (i.e. built against the Lambda AMI inside of docker), but keep them away from your code during development.npm install serverless-custom-packaging-plugin --save-dev
This installs the plugin into your node_modules
and adds the dev-dependency to your package.json
.
plugins:
- serverless-custom-packaging-plugin
...
functions:
myFunction:
...
package:
path: path/to/my/code
artifact: path/to/my/artifact.zip
libs: path/to/libs
include_globs:
- "**/*.py"
- "**/*.json"
Serverless version | serverless deploy | serverless package -f <function-name> | serverless deploy function -f <function_name> | comment |
---|---|---|---|---|
1.10.0 | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | ||
1.11.0 | not tested | |||
1.12.0 | not tested | |||
1.13.0 | not tested | |||
1.14.0 | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | |
1.15.0 | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | |
1.16.0 | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | |
1.17.0 | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> / <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | everything works when patched |
1.18.0 | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/46/check-mark-2180770_960_720.png width=25> | <img src=https://cdn.pixabay.com/photo/2017/03/28/01/42/attention-2180765_960_720.png width=25> | package.individually = true must be set |
We have created a couple of patches (so far only for serverless version 1.17.0) to get all the functionality we needed working. You are free to use these patches, but be aware that this could potentially break (other) serverless functionality.
This is a work in progress. This means no guarantees that everything will work as promised. If you would like some more functionality you are welcome to contribute. We greatly appreciate any testing you do with different serverless versions and setups.