rhythmic-actor-14991
06/02/2021, 3:53 AMbillowy-army-68599
06/02/2021, 3:54 AMrhythmic-actor-14991
06/02/2021, 3:57 AMconst 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,
},
);