Invoke AWS Lambda function only once, at a single specified future time

前端 未结 6 1502
无人共我
无人共我 2020-12-29 07:12

I want to be able to set a time to invoke an AWS Lambda function, then have that function be invoked then and only then. For example, I want my Lambda function to run at 9:0

6条回答
  •  庸人自扰
    2020-12-29 07:49

    I understand its quite late to answer this question. But anyone who wants to use CRON expression to trigger an event(or call an API) only once can use following example:

    This event will be triggered only once on January 1, 2025 - 12:00:00 GMT

    00 12 01 01 ? 2025
    

    For those who do not have much knowledge of cron syntax:

    Minutes Hours DayOfMonth Month DayOfWeek Year
    

    I am using this with AWS Cloudwatch Events and the result looks like this:

    Note: I did not have to specify Day of week, since I have given it a fixed date and thats obvious.

提交回复
热议问题