Skip to content

About

Terraform module to create a responsive Maintenance Page using Cloudflare Workers.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Terraform-Cloudflare-Maintenance

Terraform module to create a responsive Maintenance Page using Cloudflare Workers.

Preview

Preview

You can preview the full page here.

Usage

A detailed explanation of the implementation can be found here.

Simple maintenance page with your logo, fav icon, company name, font and email:

Export cloudflare auth

TF_VAR_cloudflare_api_key=xxx
TF_VAR_cloudflare_email=xxx
# or
TF_VAR_cloudflare_token=xxx

If using token, make sure it has all the necessary permissions

module "hodovi_cc_maintenance" {
  source          = "git::git@github.com:adinhodovic/terraform-cloudflare-maintenance.git?ref=v0.3.0"
  cloudflare_zone = "hodovi.cc"
  patterns        = ["hodovi.cc/maintenance/*"]
  company_name    = "HoneyLogic"
  email           = "support@honeylogic.io"
  font            = "Poppins"
  logo_url        = "https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic-blue.original.png"
  favicon_url     = "https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic_-_icon.original.height-80.png"
}

Use the enabled flag to enable/disable the Cloudflare route when maintenance starts/ends:

module "hodovi_cc_maintenance" {
  source          = "git::git@github.com:adinhodovic/terraform-cloudflare-maintenance.git?ref=v0.3.0"
  enabled         = false
  cloudflare_zone = "hodovi.cc"
  patterns        = ["hodovi.cc/maintenance/*"]
  company_name    = "HoneyLogic"
  email           = "support@honeylogic.io"
  font            = "Poppins"
  logo_url        = "https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic-blue.original.png"
  favicon_url     = "https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic_-_icon.original.height-80.png"
}

Inputs

Variable Description Required Type Default
enabled Flag to create/delete the worker route. False Bool true
cloudflare_zone The Cloudflare Zone. True String -
patterns The DNS patterns to deploy the maintenance page to. True list(String) -
email The email address for used for support inquiries. True String -
company_name Your company name. True String -
font Google font that should be used. False String "Poppins"
whitelist_ips The IPS that are whitelisted to bypass the maintenance page. False List separated by commas e.g "1.1.1.1,2.2.2.2" "placeholder"
logo_url The logo to be displayed. True String -
favicon_url The favicon to be displayed. False String A maintenance icon from the web.

Ensure that the Google Font is identical in casing e.g "PT Sans" can't be "Pt Sans" otherwise it'll fail to fetch the font.

Example can be found in examples/root-example.

About

Terraform module to create a responsive Maintenance Page using Cloudflare Workers.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages