Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in AWS by (19.1k points)

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:00 pm on July 24th, 2019. I don't want it to repeat, I don't want it to invoke now, just at 9:00 pm on the 19th. 

I understand that CloudWatch provides Scheduled Events, and I was thinking that when a time to schedule this reminder for is inputted, a CloudWatch Scheduled Events are created to fire in that amount of time from now (so like if you schedule it at 8:22 pm to run at 9 pm, it’ll be 38 mins), then it invokes the Lambda function at 9pm which then deletes the CloudWatch Scheduled Event. My issue with this is that when a CloudWatch Scheduled Event is created, it executes right then, then at the specified interval.

Any other ideas would be appreciated, as I can't think of another solution.

closed

1 Answer

0 votes
by (44.4k points)
selected by
 
Best answer

Use this following syntax:

cron(Minutes Hours Day-of-month Month Day-of-week Year)

Only UTC is allowed, not any other time zone.

Check out this documentation for more details - Schedule Expressions Using Rate or Cron

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...