我想基于cloudwatch事件中添加的规则来触发lambda函数。我看到了在这样的控制台中执行此操作的示例,
UPDATE Attendance
SET ShiftCode = ISNULL((SELECT ShiftCode FROM Shifts Roster
WHERE CAST(COALESCE(CheckIn, CheckOut) AS DATE) BETWEEN StartDate AND EndDate AND EmpCode = Attendance.EmpCode),
(SELECT ShiftCode FROM EmployeeInfo WHERE EmployeeInfo.ID = Attendance.EmpCode))
我想添加我的lambda函数作为目标。有没有办法使用boto3做到这一点?
答案 0 :(得分:0)
通过boto3调用lambda函数。参见documentation
下面是示例。
response = client.invoke(
ClientContext='MyApp',
FunctionName='MyFunction',
InvocationType='Event',
LogType='Tail',
Payload='fileb://file-path/input.json',
Qualifier='1',
)