2 Answers
- Newest
- Most votes
- Most comments
2
I would use a different approach. Use EventBridge to schedule a daily Step Functions process. The Step Functions workflow will handle the retrieving of the file using a Lambda function. Step Functions has built in Retries. You will set the Interval to 900 seconds (15 minutes) maximum retries to 8 (first try + 8 retries = 2 hours). So a single step in Step Functions will retrieve the file as designed.
0
Maybe you could trigger the lambda when the file is uploaded to S3. Then you could use a DynamoDB table to store how long since the last trigger if you want to write some logic around that.
answered 2 years ago
Relevant content
- asked 2 years ago
- asked 4 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
My question, is about the lambda hitting the external api with the event bridge scheduler for every 15 mins, to pull a file from an external api. If the lambda is successful, in retrieving the file, then how can I stop the event bridge scheduler to stop from further asking the Lambda to trigger the external api for that day. Only if the external api call is failed, then only the even bridge scheduler should re-trigger in the next 15 minutes.