From the course: AWS Quick Tips for Developers

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Scheduling a Lambda to run regularly

Scheduling a Lambda to run regularly

- [Instructor] If you have a Lambda, and you want to run it periodically like every hour, once a day overnight, or every five minutes, you can do that easily in CloudWatch. I have a function here that's just called Hello World. It doesn't really do anything, but it's good for this example. So I'm going to go to CloudWatch, and under Events, I'm going to select Rules. And here I'm going to create a rule and select Schedule for how often I want it to run. We can have a fixed rate of every minutes, hours, or days. If you're familiar with cron expressions, you can put that in here as well. Then we're going to add our target. For us, it's the Hello World example. We're not going to configure anything for the version or alias, we'll select the defaults. Also same for the input. And then we configure the details, which is just a name, like Hello Schedule, and a description like Hello. And now every five minutes, when I create this rule, it'll run my Lambda. Hopefully in your case, it'll do…

Contents