Skip to content
How to reduce drastically lambda size
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib bugfix for serverless old versions #3 Mar 4, 2019
src bugfix for serverless old versions #3 Mar 4, 2019
.babelrc
.editorconfig first commit Feb 14, 2019
.eslintrc added travis file Feb 19, 2019
.gitignore first commit Feb 14, 2019
.travis.yml
CHANGELOG.md added change log Feb 19, 2019
README.md
package.json

README.md

serverless-layers

serverless Issues License NPM Build Status PRs Welcome

  • Automatically attach layers for each lambda function
  • Creates a new layer version when package.json was updated
  • 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

Requirements

  • Serverless >= 1.34.0 (layers support)
  • Node >= v6.10.3
  • NPM >= 3.10.10
  • AWS only (sorry)
  • A valid package.json file

Install

npm install -D serverless-layers

Add the plugin to your serverless.yml file:

Serverless configuration

provider:
  ...
  deploymentBucket: #required!
    name: "your_bucket"

package:
  individually: false
  exclude:
    - node_modules/**
  excludeDevDependencies: true

plugins:
  - serverless-layers

Options

custom:
  serverless-layers:
    compileDir: '.serverless',
    packagePath: 'package.json',
    compatibleRuntimes: ['nodejs'],
    layersDeploymentBucket: "your_layers_bucket"

Contributing

Yes, thank you! This plugin is community-driven, most of its features are from different authors. Please update the docs and tests and add your name to the package.json file. We try to follow Airbnb's JavaScript Style Guide.

License

MIT

You can’t perform that action at this time.