Skip to content

vharmain/serverless-healthcheck

Repository files navigation

serverless-healthcheck

Simple health checker Lambda with ClojureScript, shadow-cljs and AWS SAM. Can alert via email or SMS using AWS SNS/SES.

Screenshot of alert SMS message

Prerequisites

On a Mac you can install these with Homebrew:

brew install node aws-sam-cli

Install dependencies

npm install

Configuration

Create a .env.sh file with your configuration:

export AWS_REGION=eu-west-1
export HEALTHCHECK_URLS=https://example.com,https://api.example.com
export DELIVERY_METHOD=email  # or sms
export [email protected]
export [email protected]
export SMS_PHONE_NUMBER=+1234567890
export SMS_SENDER_ID=MyAlert

Deploy

npm run deploy

This will build the ClojureScript, package with production dependencies only, and deploy to AWS.

SES email setup

You need to verify sender and recipient email addresses in order to send email through SES. If you want to send emails to non-verified recipients you need to move out of the sandbox.

SES setup is not required if sms delivery method is used instead of email.

Set invoke schedule

See AWS Lambda docs on cron and rate syntax and edit the schedule in template.yaml accordingly. Default is every 15 minutes.

About

Simple health checker lambda with ClojureScript, shadow-cljs and Serverless Framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •