- Automatically attach layers for each lambda function
- Creates a new layer version when
- If package.json was not changed, it does not publish a new layer
- Reduces drastically lambda size
- It reduces deployment time.
- Share same layers (libraries) with all lambda functions
- Serverless >= 1.34.0 (layers support)
- Node >= v6.10.3
- NPM >= 3.10.10
- AWS only (sorry)
- A valid package.json file
npm install -D serverless-layers
Add the plugin to your
provider: ... deploymentBucket: #required! name: "your_bucket" package: individually: false exclude: - node_modules/** excludeDevDependencies: true plugins: - serverless-layers
custom: serverless-layers: compileDir: '.serverless', packagePath: 'package.json', compatibleRuntimes: ['nodejs'], layersDeploymentBucket: "your_layers_bucket"