Aso Sun
09/11/2021, 9:48 AMError: Invalid function definition for the "Job" Function
import { Cron, Function } from "@serverless-stack/resources";
this.function = new Function(this, 'scheduled', {
            handler: "src/scheduled.main",
            environment: {
                TABLE_NAME: table.tableName,
            }
        })
this.cron = new Cron(this, 'cron', {
            schedule: "cron(0 1 * * ? *)"
            job: {
                function: this.function    
            },
        })
this.cron.attachPermissions([table])Frank
this.cron = new Cron(this, 'cron', {
            schedule: "cron(0 1 * * ? *)"
            job: this.function
        })Frank
import { Cron } from "@serverless-stack/resources";
this.cron = new Cron(this, 'cron', {
  schedule: "cron(0 1 * * ? *)"
  job: {
    handler: "src/scheduled.main",
    environment: {
      TABLE_NAME: table.tableName,
    },
    permissions: [table],
  },
})
this.function = this.cron.jobFunction;Aso Sun
09/11/2021, 11:38 PM