Hi there, anyone has experience scheduling lambda ...
# help
p
Hi there, anyone has experience scheduling lambda invocations with second precision? As far as I know, dynamo ttl is always a couple minutes late and the Cron construct (which uses EventBridge) is minute precision. I need something that invokes a lambda with second or sub-second precision. Any ideas?
g
I use AWS StepFunction, put a Wait state before a Task
t
People have done this with funny stepfunctions that sleep every second
bingo
a
There are many blogs with various techniques. You should be able to find them by Googling. Don't count on DynamoDB TTL for accuracy under four hours - it's usually faster but that's the guarantee level. A good technique that is easier/cheaper than step function is a scheduled EventBridge once a minute that then shoves the events for the next minute or fifteen into an SQS queue with delay to obtain per-second resolution.
If you aren't scheduling anything more than 15 minutes out, you can just use SQS. https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-timers.html