我正在使用AWS Cloudwatch事件规则按Cron计划调用Python Lambda函数,这个功能很好。现在我可以使用AWS Cloudformation从Cloudwatch事件规则将参数传递到Lambda函数中吗?您能否指导一下?
请查看下面的CFN模板:
Step1 : parameter.Schedule=cron(0 21 ? * * *)
Step 2: "Schedule": {
"Description": "Schedule for the Lambda function (cron or rate)",
"Type": "String"
},
Step 3: "funcInvokeRule": {
"Type": "AWS::Events::Rule",
"Properties": {
"ScheduleExpression": {"Ref": "Schedule"},
"Targets": [{
"Id": "funcScheduler",
"Arn": {"Fn::GetAtt": ["Function","Arn"]}
}]
}
},