I’ve got a use case where I need to run a scheduled lambda via cron periodically, like every 15 minutes, and I need to query a DynamoDB table to for entries where the key is the exact epoch when the cron was scheduled to run. For example, if the lambda is scheduled to run at
1/1/22 09:15:00, I need that epoch, and not the current time when the lambda is actually started (typically a few seconds later). Is there any way to get that “scheduled time” in the lambda function?
Alternatively it seems like I can probably take the current time and round it down to the 15 minute interval. Annoying, but not the end of the world I guess as long as the lambda never starts BEFORE the scheduled time. I assume that it always runs at or slightly after the scheduled time.
I really thought I saw this information in the past, but I can’t seem to find it in any of my current lambda cron logs…
Any suggestions would be appreciated.