Is there not a capability to disable the eventBridge in our serverless.yml file?
timeout: 60
runtime: nodejs12.x
events:
- eventBridge:
schedule: cron(0 0 * * ? *)
enabled: false
Doc does not seem to specify?
Is there not a capability to disable the eventBridge in our serverless.yml file?
timeout: 60
runtime: nodejs12.x
events:
- eventBridge:
schedule: cron(0 0 * * ? *)
enabled: false
Doc does not seem to specify?
I can confirm that enabled: false
does not work for eventBridge
events. My workaround was to use a schedule
event instead. Here’s an example workaround:
events:
- schedule:
rate: cron(0 0 * * ? *)
enabled: false
description: Using schedule instead of eventBridge for scheduled events
Note that when I changed my yaml to this new method, the new rule was properly added (as disabled). However, the old rule (which had a different automatic resource name) was never deleted and had to be deleted manually. This was pretty insidious since I could see my new disabled rule, but my function kept triggering.
I believe that two above issues are bugs. It would be good if the doc would at least note the enabled: false
limitation until this is fixed.
There are some other asymmetries with scheduled eventsBridge
too. For example, schedules must run on the default
eventBus. Therefore, the eventBus
property for a scheduled eventBridge
event won’t work (this is an AWS limitation).