How To Run A Serverless Scheduled Function Using AWS Lambda & EventBridge

Uriel Bitton
Success With AWS
Published in
6 min readApr 1, 2024

--

A simple guide on running code on a schedule without managing any servers with AWS Lambda

Photo by Towfiqu barbhuiya on Unsplash

AWS EventBridge, formerly known as CloudWatch Events, is a serverless service that lets you run scheduled services and integrates with a wide variety of AWS services.

In this article we’ll guide you through the easiest and quickest way to run a serverless function on a schedule we define.

With everything being serverless, we don’t need to provision servers so we can do this on-demand, making it super flexible and easy to test and use in production.

The general idea is this: we will run a scheduled event using EventBridge, which will trigger a Lambda function, which in turn will write an item to a DynamoDB table.

A typical use case in real applications where you want to add items to your table on a schedule. It can be something like adding a featured post to a blogging website.

We’ll accomplish this is 3 easy steps:

  1. Create a DynamoDB table
  2. Create a Lambda function with proper permissions
  3. Create a schedule rule in EventBridge

Let’s start.

1. Create a DynamoDB Table

--

--

Uriel Bitton
Success With AWS

I write about AWS services, serverless technology, cloud computing, and cost-efficiency and help you learn how to easily build robust web apps.