Serverless Select Plugin
Select which functions are to be deployed based on region and stage.
Note: Requires Serverless v1.12.x or higher.
Install via npm in the root of your Serverless service:
npm install serverless-plugin-select --save-dev
- Add the plugin to the
pluginsarray in your Serverless
serverless.yml, you should place it at the top of the list:
plugins:- serverless-plugin-select- ...
stagesin your functions to select for deployment
Run deploy command
sls deploy --stage [STAGE NAME] --region [REGION NAME]or
sls deploy function --stage [STAGE NAME] --region [REGION NAME] --function [FUNCTION NAME]
Functions will be deployed based on your selection
How it works? When deployment region or stage don't match function regions or stages, that function will be deleted from deployment.
regions - Function accepted deployment regions.
functions:hello:regions:- eu-west-1- ...
- stages - Function accepted deployment stages.
functions:hello:stages:- dev- ...
Help us making this plugin better and future proof.
- Clone the code
- Install the dependencies with
- Create a feature branch
git checkout -b new_feature
- Lint with standard
npm run lint
This software is released under the MIT license. See the license file for more details.