Yann
Yann

Reputation: 2532

How to specify a custom message for a scheduled cloudwatch trigger for lambda?

I need to trigger a lambda function on some schedule and use cloudwatch for it. However, I need the labmda to be triggered with different parameters. Is there a way to specify message for a cloudwatch event? Is there any other way to trigger lambda on schedule with different messages?

Upvotes: 1

Views: 435

Answers (1)

Ninad Gaikwad
Ninad Gaikwad

Reputation: 4480

When you create a Rule under EventBridge, you have multiple options for giving an input.

enter image description here

If your rule is triggered by an event, then you can select option 1 or 2. If you want to specify a constant input you can enter it as JSON text with the third option.

Since you are planning to use schedule, you can go for option 3, Constant. You can define multiple rules if you have different inputs or you can store your inputs in a table and then fetch them as needed. Depends on your requirement.

Upvotes: 3

Related Questions