Simple health checker Lambda with ClojureScript, shadow-cljs and AWS SAM. Can alert via email or SMS using AWS SNS/SES.
On a Mac you can install these with Homebrew:
brew install node aws-sam-clinpm installCreate 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=MyAlertnpm run deployThis will build the ClojureScript, package with production dependencies only, and deploy to AWS.
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.
See AWS Lambda docs on cron and rate syntax and edit the schedule in template.yaml accordingly. Default is every 15 minutes.
