• Stars
    star
    125
  • Rank 284,802 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Terraform-Cloudflare-Maintenance

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

The module can be used through Terraform's registry.

Preview

Preview

You can preview the full page here.

Usage

A detailed explanation of the implementation can be found here.

Export cloudflare credentials

TF_VAR_cloudflare_email=xxx
TF_VAR_cloudflare_api_key=xxx
TF_VAR_cloudflare_account_id=xxx

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

Simple maintenance page with your logo, fav icon, company name, font and email with multiple routes on the same domain:

module "hodovi_cc_maintenance" {
  source          = "git::[email protected]:adinhodovic/terraform-cloudflare-maintenance.git?ref=v0.6.0"
  cloudflare_zone = "hodovi.cc"
  patterns        = ["hodovi.cc/maintenance/*", "hodovi.cc/example/*"]
  company_name    = "HoneyLogic"
  email           = "[email protected]"
  statuspage_url  = "https://status.hodovi.cc"
  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::[email protected]:adinhodovic/terraform-cloudflare-maintenance.git?ref=v0.6.0"
  enabled         = false
  cloudflare_zone = "hodovi.cc"
  patterns        = ["hodovi.cc/maintenance/*"]
  company_name    = "HoneyLogic"
  email           = "[email protected]"
  statuspage_url  = "null"
  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"
}

Example can be found in examples/root-example.

Requirements

Name Version
terraform >= 0.13
cloudflare > 2.0.0

Providers

Name Version
cloudflare > 2.0.0

Resources

Name Type
cloudflare_worker_route.this resource
cloudflare_worker_script.this resource
cloudflare_zones.this data source

Inputs

Name Description Type Default Required
cloudflare_zone n/a string n/a yes
company_name n/a string n/a yes
email The email address to used for support inquiries. string n/a yes
enabled Flag to create/delete the worker route. bool true no
favicon_url The favicon to be displayed. Defaults to a maintenance icon from the web. string "https://cdn1.iconfinder.com/data/icons/ios-11-glyphs/30/maintenance-512.png" no
font Google font that should be used. string "Poppins" no
logo_url The logo to be displayed. string n/a yes
patterns The DNS pattern list to deploy the maintenance page to. list(string) n/a yes
statuspage_url The status page address to get updated information. string "null" no
whitelist_ips The IPs that are whitelisted to bypass the maintenance page. string "null" no
whitelist_path The paths that are whitelisted defined with a regex expression to bypass the maintenance page. string "null" no

Notes

Get fonts from Google fonts. 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.

More Repositories

1

wagtail-resume

A Wagtail project made to simplify creation of resumes for developers.
Python
90
star
2

django-admin-shellx

A Django Admin Web Shell using Xterm.js and Django Channels.
Python
76
star
3

django-mixin

Monitoring mixin for Django-prometheus. A set of Grafana dashboards and Prometheus rules for Django.
Jsonnet
44
star
4

django-google-optimize

Django-google-optimize is a Django application designed to make running server side Google Optimize A/B tests easy.
Python
40
star
5

argo-cd-mixin

Monitoring mixin for ArgoCD. A set of Grafana dashboards and Prometheus rules for ArgoCD.
Jsonnet
34
star
6

tanka-argocd-demo

A demo of using Tanka as a plugin for ArgoCD
Jsonnet
22
star
7

blackbox-exporter-mixin

A mixin for the blackbox-exporter. A set of Grafana dashboards and Prometheus rules for the Blackbox-exporter..
Jsonnet
20
star
8

ingress-nginx-mixin

Monitoring mixin for Ingress-nginx. A set of Grafana dashboards and Prometheus rules for Ingress-nginx.
Jsonnet
17
star
9

rabbitmq-mixin

Monitoring mixin for RabbitMQ. A set of Grafana dashboards and Prometheus rules for RabbitMQ.
Jsonnet
6
star
10

django-custom-error-views

Prebuilt and customizable error views for Django.
Python
6
star
11

dotfiles

My personal dotfiles. Nvim, Linux, i3, Zsh
Lua
5
star
12

terraform-cloudflare-gmail

HCL
2
star
13

terraform-cloudflare-zone-rules

Terraform module that creates opionated Cloudflare zone rules
HCL
2
star
14

terraform-mailgun-cloudflare

HCL
2
star
15

cheats

1
star
16

ansible-k8s-terraform

Dockerfile
Dockerfile
1
star
17

kubernetes-alias

Shell
1
star
18

terraform-alias

Shell
1
star
19

docker-compose-alias

Shell
1
star
20

ansible-alias

Shell
1
star
21

celery-mixin

Jsonnet
1
star
22

docker-alias

Shell
1
star
23

git-alias

Shell
1
star