serverless-fargate icon indicating copy to clipboard operation
serverless-fargate copied to clipboard

Support for EventBridge AWS::Scheduler::Schedule instead of AWS::Event::Rule

Open vinibs opened this issue 2 years ago • 2 comments

Hi! I am setting up a project to configure multiple Fargate instances, all of them scheduled, and was wondering if the plugin has already the ability to schedule the Fargate instance using the AWS::Scheduler::Schedule resource instead of the default AWS::Event::Rule. I saw on Serverless docs that they have a section about how to do it for a Lambda, however I don't think it would apply to the Fargate created through this plugin.

Is that already possible? If so, how can I do it? It's my first experience using Serverless and this plugin, so I may be just missing something, but I would really appreciate any help.

Thanks in advance.

vinibs avatar Oct 04 '23 20:10 vinibs

Its possible to borrow the code from serverless:

https://github.com/serverless/serverless/blob/main/lib/plugins/aws/package/compile/events/schedule.js#L203-L292

and put it instead of this:

https://github.com/eddmann/serverless-fargate/blob/main/src/compiler.js#L149-L179

adminy avatar Feb 19 '24 18:02 adminy

This is an interesting idea, how would you feel about a similar API?

schedule:
     method: scheduler
     rate:
       - cron(0 0/4 ? * MON-FRI *)
     timezone: America/New_York

eddmann avatar Jul 12 '24 18:07 eddmann