Sails command to deploy actions as AWS Lambda functions via the Serverless framework
Last updated 3 years ago by sgress454 .
MIT · Original npm · Tarball · package.json
$ cnpm install sails-run-deploy-serverless 
SYNC missed versions from official npm registry.


A Sails command to deploy actions as AWS Lambda functions via the Serverless toolkit.


First, install Serverless:

npm install -g serverless

and follow the instructions for setting your AWS credentials.

Then, install this command in your Sails app:

npm install sails-run-deploy-serverless

and invoke using sails run deploy-serverless <options>.


The available options (you must choose one and only one) are:

  • --all: deploy (or redeploy) all functions. You may need to do this when first adding a new endoint, or modifying the URL of an existing one.
  • --f <function name>: deploy only the function with the specified name. Function names are the camel-cased version of the action name in Sails; for example, the action in api/controllers/user/get.js corresponds to a function named userGet.
  • --nodeploy: just generate the serverless folder, but don't actually deploy. You can then go into the folder and deploy yourself with the Serverless CLI.

Note that every time you run the command, the local serverless folder is recreated.


TODO: document serverless-dev and serverless-prod


TODO: document route authorization


TODO: document CORS



This file allows you to declare which parts of your Sails app should be copied into the package that is deployed to AWS. Available settings are:

  • include: An array of file or folder paths (relative to the project root) to copy into the deployment package. Defaults to ['api/controllers', 'api/helpers', 'api/models', 'config/models.js', 'config/datastores.js'].

  • transpile: An array of file or folder paths (relative to the project root) to transpile to ES5 before deploying. At this time, Lambda only supports Node 6. Defaults to ['api/controllers', 'api/helpers', 'api/models'].

  • defaultAuthorizer: The name of an authorizer function to use as the default for any route that doesn't explicitly set an authorizer option. If left unset, routes will not be authorized by default.

  • orm: Set to false if you don't want the deployed Lambda functions to use the Waterline ORM.


This command creates a serverless.yml file with some sane defaults. If you create a config/serverless.yml file in your app, it will be used as the basis for the YML file that the deploy-serverless command creates. This is useful for setting up environment variables, VPCs, AWS Gateway Responses, etc.



Current Tags

  • 0.3.5-2                                ...           beta (3 years ago)
  • 0.3.5                                ...           latest (3 years ago)

17 Versions

  • 0.3.5                                ...           3 years ago
  • 0.3.5-2                                ...           3 years ago
  • 0.3.5-1                                ...           3 years ago
  • 0.3.5-0                                ...           3 years ago
  • 0.3.4                                ...           3 years ago
  • 0.3.3                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (10)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2017 © |