Serverless Remove Scheduled Events By StageThis plugin helps manage stage deployment where you don't want to schedule events with serverless.
For instance if you have a
devstage where you only want to trigger events manually, it can be hard to make sure that this stage doesn't get scheduled (potentially breakind other stages or leading to dead dev code run on accident automatically).
InstallationFirst install the plugin with
npm install --dev serverless-remove-scheduled-events-by-stage yarn add --dev serverless-remove-scheduled-events-by-stage
Next add the plugin to the plugins array and add config to
plugins: - serverless-remove-scheduled-events-by-stage custom: some-other-config: Hello World remove-schedule: stages: - dev
The stages array can be modified to any set of strings where you want to remove events with scheduled events. If no
remove-schedule.stagesarray is provided, this plugin defaults to removing scheduled events for the
service: my-service provider: name: aws runtime: nodejs8.10 plugins: - serverless-remove-scheduled-events-by-stage custom: some-other-config: Hello World remove-schedule: stages: - dev - test functions: hello: handler: handler.hello events: - schedule: cron(12 * * * ? *) - sns: dispatch
With this config in
staging, etc the config will be left alone. However in
eventsfor the function
hellowill only have an event for
snssince the schedule event is removed! All other events and configs will be left alone.