9

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. The event will contain a Document ID which will be used in the Lambda code. Currently, the EventBridge does not have the feature to send custom events to target for Rule Type Schedule. The custom event here is the Document ID which I want the Lambda function to receive as an event. How can I achieve this?

4
  • What do you mean by "EventBridge is not allowing to send custom events for Rule Type Schedule"? What do you consider to be a "custom event"? When you say that you want the Lambda function to receive an event, what event do you want it to receive? Please Edit your question to add these additional details, rather than answering via a comment. Commented Mar 21, 2022 at 5:19
  • @JohnRotenstein thank you for the suggestions. Added details to the question Commented Mar 21, 2022 at 5:26
  • Are you saying that you would like to invoke an AWS Lambda function every 10 minutes and you would like to pass specific information in the event that will be received by the Lambda function? Will this information be static (that is, the same every time that the function is invoked), or will it change each time (in which case, where does that data come from)? Commented Mar 21, 2022 at 5:28
  • Yes, I would like to invoke an AWS Lambda function every 10 minutes and pass static information in the event that will be received by the Lambda function. Commented Mar 21, 2022 at 5:31

1 Answer 1

15

It appears that your goal is:

  • Trigger an AWS Lambda function every n minutes
  • Pass static information in the event that will be received by the Lambda function

You can do this when configuring the target for a scheduled event:

  • Select the Lambda function as a target
  • In Additional Settings select "Configure target input" and Constant (JSON text)

The event will then be available in the Lambda function via the event parameter:

AWS EventBridge specify constant

Sign up to request clarification or add additional context in comments.

4 Comments

Any chance you know the pattern to accomplish the same via CloudFormation? I am can trigger a lambda regularly via a AWS::Events::Rule w/ a ScheduleExpression pattern but am unclear on how to include a constant JSON as shown above. Was hoping the docs would help here, but perhaps am missing something obvious.
I think it would use the Input field in AWS::Events::Rule Target, which is referenced from AWS::Events::Rule.
Do you know how could do it with yaml?
@PedroHenrique The above documentation page for Rule Target shows a YAML example that references Input.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.