Serverless Deployment Group
Serverless Deployment Group is a plugin that allows to select which functions are to be deployed based on an aggrupation variable.
First, you have to set
serverless-deployment-group-plugin plugin by running:
serverless plugin install --name serverless-deployment-group-plugin
This will install the required npm package and add the plugin to your
- node: >= 8.0.0
- npm: >= 1.64.0
- serverless: >= 1.34
deployment-groupoption is present in deploy command, this plugin removes those functions in node functions (in serverless.yml) which don't match with selected groups.
- Add an aggrupation name (
deployment-group) for one or more functions:
...functions:function1:deployment-group: group_Ahandler: index.handlername: function1function2:deployment-group: group_Ahandler: index.handlername: function1function3:deployment-group: group_Bhandler: index.handlername: function1...
Run deploy command
sls deploy --deployment-group group_A.
Functions will be deployed based on your selection group. In this example: function1 and function2.