Skip to content

enicholson125/is-my-site-up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

is-my-site-up

This pings a URL and emails you if it doesn't return 200. It is packaged into a Terraform module that creates a Google Cloud Function that by default runs every day. The resources created by the module, run at the default once a day frequency, are within the Google free tier.

Setup

Requirements

  • A Gmail account to send the email. I strongly recommend that you create a dedicated account for this, as configuring a Gmail account to be accessible to this script involves disabling security features, such as turning on less secure apps access.
  • Google Cloud Platform account
  • Terraform

Configure the Gmail account

Run the Terraform

  • You will need the Cloud Functions, Cloud Scheduler and Cloud Build APIs enabled to run the terraform. Terraform prompts you to enable them so personally I keep applying and clicking through on the enable links until it works
  • You will need to create an App Engine instance (don't run any actual code on it if you want to stay in the Google free tier)

Invoke the module in your terraform, e.g.

module "cheatsheet" {
  source = "./terraform"

  gmail_account  = "[email protected]"
  urls_to_check  = "https://terraform-cheatsheet.uk"
  email_to_alert = "[email protected]"
}

Run terraform plan and terraform apply to create the Cloud Function.

You will then need to manually create the Gmail password secret in Cloud Secrets and add it to the Cloud function by following this documentation (add it as an environment variable called GMAIL_PASSWORD). It's not currently possible to configure that in the terraform cloud function definition but it hopefully will be soon.

About

Lightweight website monitoring for personal projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published