Serverless

2 Minute Tip: Schedule Calling Webhooks with Cron Like Syntax in AWS Lambda

Jared Short Trek10
Jared Short | Mar 06 2017

Mon, 06 Mar 2017

Today we were looking for a quick way to replace scheduled jobs in Jenkins with GitLab CI. Unfortunately GitLab CI does not support scheduled runs.

Being the lambda lovers we are, we figured a quick scheduled lambda function could fix this. However, I took it one step further and built a general usage “scheduled Cron webhook caller”.

Setup

Go to your AWS Console, create a new “Blank” lambda function. Configure a scheduled event that looks like the following…

Configuration for Lambda Scheduled Cron Webhook Caller

Hit next, fill in the rest of the info as you please, make sure you use Node.js 4.3 as your runtime. Use a basic execution role or create one if need be. Set memory to 512MB and timeout to 30 seconds. That’s it! You're good to use your “scheduled Cron webhook caller”!

Copy paste in the below code, edit your webhookURLs and away you go. You can also check out the full source. Happy Webhooking!

Author