Scheduled Amazon EventBridge rule for AWS Lambda

EventBridge → AWS Lambda

Create an scheduled EventBridge rule that invokes a Lambda function

This template deploys a Lambda function that is triggered by an EventBridge Schedule. In this example, the Lambda function logs text to the console every minute.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-scheduled-lambda

Deploy

sam deploy --guided


Testing

After running sam deploy, go to the Lambda console.
Find the deployed Lambda function, and open the CloudWatch Logs. You will see a new log event every minute.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Julian Wood

Julian Wood

I help developers and builders learn about and love how serverless technologies can transform the way they build and run applications.

Follow on LinkedIn