简体   繁体   English

如何从 EventBridge 发送事件到 Lambda

[英]How to send event from EventBridge to Lambda

I want the Lambda function to be triggered every 10 minutes and the function to receive an event in the form of JSON from EventBridge.我希望 Lambda function 每 10 分钟触发一次,function 从 EventBridge 接收 JSON 形式的事件。 The event will contain a Document ID which will be used in the Lambda code.该事件将包含将在 Lambda 代码中使用的文档 ID。 Currently, the EventBridge does not have the feature to send custom events to target for Rule Type Schedule.目前,EventBridge 没有将自定义事件发送到规则类型计划目标的功能。 The custom event here is the Document ID which I want the Lambda function to receive as an event.这里的自定义事件是我希望 Lambda function 作为事件接收的文档 ID。 How can I achieve this?我怎样才能做到这一点?

It appears that your goal is:看起来你的目标是:

  • Trigger an AWS Lambda function every n minutesn分钟触发一个AWS Lambda function
  • Pass static information in the event that will be received by the Lambda function传递static信息在活动中会被Lambda function收到

You can do this when configuring the target for a scheduled event:您可以在为预定事件配置目标时执行此操作:

  • Select the Lambda function as a target Select Lambda function 作为目标
  • In Additional Settings select "Configure target input" and Constant (JSON text)附加设置select“配置目标输入”和常量(JSON 文本)

The event will then be available in the Lambda function via the event parameter:然后事件将通过event参数在 Lambda function 中可用:

AWS EventBridge 指定常量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM