Pass Events to lambda through eventrule

0

Usually, in lambda, I used to use the events, where I used to trigger the lambda manually. Later on, the eventrule(cronjob) is used to trigger the lambda automatically. But the events in the lambda aren't accepting, rather the events from the eventrule are passed into lambda. How can I pass events to a lambda that is been triggered through eventrule(cronjob).

1개 답변
1

What event do you want to pass to Lambda when invoked from the scheduled rule? The schedule itself is the event in this case.

profile pictureAWS
전문가
Uri
답변함 10달 전
  • I have my own custom event in lambda as the below. { "fromadd": "developer@gmail.com", "frompass": "adcdefghikj", "mongousers": [ { "dbusername": "admintestuser", "dbpass": "Password321", "email": "admintest@gmail.com" } ] } But I'm unable to pass these since the eventbridge overwrites the events to lambda

  • First, I am guessing that you want to send the same information in each invocation. In this case I would use environment variables to store these values, or better yet, store the names of parameters in Secretes Manager or SSM.

    Second, if you still prefer to send these value in the event, and if you are using scheduled rules (consider moving to EventBridge Scheduler), when you set up the rule, you can choose in the Additional Settings section in the console to send a constant JSON. If you are using the EB Scheduler, when you configure the schedule, you need to specify the payload that will be sent to the function.

  • Hey, thanks Uri. I chose the Additional Settings section in the EventBridge Scheduler to send a constant JSON and I was able to pass in the json.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠