- Newest
- Most votes
- Most comments
I am suspecting you are not returning a success code from the API, which is causing a retry.
Why are you using API Gateway at all? Why not invoke the Lambda function directly from EventBridge Scheduler?
Hello.
Is it possible that you are configuring EventBridge with rate instead of cron?
If cron is configured correctly, it should be possible to run it at a specific time.
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cron-expressions.html
Also, EventBridge is sometimes executed multiple times, so this may be related.
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-troubleshooting.html#eb-rule-triggered-more-than-once
In rare cases, the same rule can run more than once for a single event or scheduled time, or the same target can be invoked more than once for a given triggered rule.
Also, are there any errors when running Lambda?
It runs at the specified time. But once it runs it keeps on running every 10 minutes. There are no errors as such.
Relevant content
- asked 2 years ago
- Accepted Answerasked 2 years ago
- Accepted Answerasked 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 15 days ago
@Uri, I was returning a success response. I am not sure if there's some specific format in which success code needs to be returned. I didn't give much thought to call the Lambda directly because I thought calling the API which in turn will invoke the function should be the same. I managed to work around it by finally calling the Lambda directly.
If you are calling the Lambda from API Gateway using Lambda Proxy integration, you should return from the Lambda function something like:
In either case, calling Lambda directly is the better approach. No need to introduce another component in the middle.