David Tsai
05/03/2022, 11:05 PMthdxr
05/03/2022, 11:05 PMJay
Andrew Barba
05/03/2022, 11:10 PMthdxr
05/03/2022, 11:11 PMFrank
Andrew Barba
05/03/2022, 11:13 PMDerek Kershner
05/04/2022, 11:00 PMCron to the migration docs. Cron.job used to be able to take a FunctionDefinition and now you need to nest it on the Cron.job.function prop.
Lack of support for events.CronOptions is also a killer loss for us (it made cron schedules composable).Frank
you might add a breaking change to@Derek Kershner Nice catch. Just updated the migrations doc. The reason for this change was there used to be 3 ways to define a cron job/route/consumer/etc. Method 1:to the migration docs.Cron
routes: {
"GET /": "lambda.main"
}
Method 2:
routes: {
"GET /": {
handler: "lambda.main"
}
}
Method 3:
routes: {
"GET /": {
function: {
handler: "lambda.main"
}
}
}
Method 2 and 3 have cause much confusion, and we decided to remove Method 2 from all constructs.Frank
Lack of support forYou can still do it like this https://docs.serverless-stack.com/constructs/Cron#configuring-the-event-rule We moved everything that uses CDK construct/class to insideevents.CronOptions
cdk. And over time if we find a prop is commonly used, we’d move them out of cdk. And when we do that, we want it to be type safe and has well written TS Doc.
In this case, I’m going to add +1 to move CronOptions out of cdk.
Hope that makes sense 😬