hi , how can i add the cronjob tigger for lambda b...
# aws
r
hi , how can i add the cronjob tigger for lambda by typescript?
b
could yoi share a little more about what's not working?
r
Copy code
const machineRobotFunc = new aws.lambda.Function("machineRobotFunc", {
   code: new pulumi.asset.AssetArchive({
     ".": new pulumi.asset.FileArchive("./robot/machine_reporter"),
   }),
    runtime: "python3.8",
   handler: "machine_reporter.handler",
    role: machineRobotRole.arn,
    environment: {
      variables: {
        "feishu_webhook": machineRobotWebookUrl
      }
    },
  }, {dependsOn: [machineRobotRole, machineRobotRolePolicy] });

 const eventRule = new aws.cloudwatch.EventRule(`machineRobotFunc-rule`,
  { scheduleExpression: "rate(5 minutes)" },
);

 const machineRobotEventTarget = new aws.cloudwatch.EventTarget("machineRobotEventTarget", {
    arn: machineRobotFunc.arn,
    rule: eventRule.id,
    },
  );
I coding like this, but the lambda didn't run ..
how can I add the cron eventbridge for the lambda?