This post is part of my “ ” series. In this part, I will show you how to setup a function to send mails on a defined scheduled event from . Serverless Lambda CloudWatch 1 — Create Lambda Function So start by cloning the project : |git clone https://github.com/mlabouardy/schedule-mail-lambda.git I implemented a simple Lambda function in to send an email using NodeJS MailGun library Note: you could use another service like or your own AWS SES SMTP server Then, create a zip file: Next, we need to create an for our function: Execution Role |aws iam create-role — role-name lambda_execution — assume-role-policy-document file://lambda_role_policy.json Execute the following command to create a . We need to provide the file, we created earlier & set and as parameters. Lambda CLI Lambda function zip IAM role ARN MAILGUN_API_KEY MAILGUN_DOMAIN |aws lambda create-function — region us-east-1 — function-name mail-scheduler — zip-file fileb://schedule-mail-lambda.zip — role arn:aws:iam::3XXXXXXX3:role/lambda_execution — handler index.sendEmail — runtime nodejs6.10 — environment Variables=”{MAILGUN_API_KEY=key-6XXXXXXXXXXXXXXXXXXXXXX5,MAILGUN_DOMAIN=sandboxXXXXXXXXXXXXXX.mailgun.org}” Note: the parameter uses but you can also specify –runtime Node.JS 6.10 Node.JS 4.3 Once created, returns function configuration information as shown in the following example: AWS Lambda Now if we go back to we should see our function has been successfuly created: AWS Lambda Dashboard 2 — Configure a CloudWatch Rule Create a new rule which will trigger our lambda function each : 5 minutes Note: you can specify the value as a or in the expression format. All schedules use the UTC time zone, and the minimum precision for schedules is one minute rate cron If you go back now to the and navigate to the tab, you should see the has been added: Lambda Function Console Trigger CloudWatch After 5 minutes, will trigger the and you should get an email notification: CloudWatch Lambda Function