Serverless Disable Functions

homepage icon https://github.com/abeMedia/serverless-disable-functions
Follow @abeMedia

Tracked

NPM Downloads Last Month
10817
Issues
0
Stars
0
Forks
0
Watchers
0
Watch Star Fork Issue Download License NPM Build Status Coverage Status Contributors

Repo README Contents:

serverless-disable-functions

A simple serverless plugin to disable functions.

Install

yarn add --dev serverless-disable-functions

or

npm install --save-dev serverless-disable-functions

Add the plugin to your serverless.yml file:

plugins:
  - serverless-disable-functions

Usage

Add the parameter enabled: false to a function to disable it. This allows you to enable/disable functions by stage like so:

service: hello-service
provider: aws
custom:
  hello_enabled:
    dev: true
    prod: false

functions:
  hello:
    handler: handler.hello
    enabled: ${self:custom.hello_enabled.${opt:stage}}