{"id":13505698,"url":"https://github.com/adinhodovic/terraform-cloudflare-maintenance","last_synced_at":"2025-06-22T02:35:54.766Z","repository":{"id":39853448,"uuid":"278433073","full_name":"adinhodovic/terraform-cloudflare-maintenance","owner":"adinhodovic","description":"Terraform module to create a responsive Maintenance Page using Cloudflare Workers.","archived":false,"fork":false,"pushed_at":"2025-05-24T10:15:03.000Z","size":75,"stargazers_count":130,"open_issues_count":0,"forks_count":30,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-24T23:10:15.630Z","etag":null,"topics":["cloudflare","cloudflare-workers","devops","maintenance","terraform","web-development"],"latest_commit_sha":null,"homepage":"https://hodovi.cc/maintenance","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adinhodovic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-09T17:49:13.000Z","updated_at":"2025-05-24T10:13:06.000Z","dependencies_parsed_at":"2023-12-14T18:49:23.823Z","dependency_job_id":"2aea56b3-a752-4aa1-918e-bff7090e193b","html_url":"https://github.com/adinhodovic/terraform-cloudflare-maintenance","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/adinhodovic/terraform-cloudflare-maintenance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fterraform-cloudflare-maintenance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fterraform-cloudflare-maintenance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fterraform-cloudflare-maintenance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fterraform-cloudflare-maintenance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adinhodovic","download_url":"https://codeload.github.com/adinhodovic/terraform-cloudflare-maintenance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fterraform-cloudflare-maintenance/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261225639,"owners_count":23127178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflare-workers","devops","maintenance","terraform","web-development"],"created_at":"2024-08-01T00:01:11.846Z","updated_at":"2025-06-22T02:35:49.749Z","avatar_url":"https://github.com/adinhodovic.png","language":"HCL","funding_links":[],"categories":["Community Modules"],"sub_categories":["Miscellaneous"],"readme":"# Terraform-Cloudflare-Maintenance\n\nTerraform module to create a responsive **Maintenance Page** using Cloudflare Workers.\n\nThe Cloudflare script intercepts all incoming requests and checks if the request is coming from an IP that is in the whitelist or if the request path matches a whitelisted path. If the request is not whitelisted, it returns a maintenance page.\n\nThe module can be used through [Terraform's registry](https://registry.terraform.io/modules/adinhodovic/maintenance/cloudflare/latest).\n\n## Preview\n\n![Preview](https://i.imgur.com/G8fJ2mj.png)\n\nYou can [preview the full page here](https://hodovi.cc/maintenance/).\n\n## Usage\n\nA detailed explanation of [the implementation can be found here.](https://hodovi.cc/blog/quick-pretty-and-easy-maintenance-page-using-cloudflare-workers-terraform/)\n\nExport cloudflare credentials\n\n```bash\nTF_VAR_cloudflare_email=xxx\nTF_VAR_cloudflare_api_key=xxx\nTF_VAR_cloudflare_account_id=xxx\n```\n\nIf using a token, make sure it has all the necessary permissions\n\nSimple maintenance page with your logo, fav icon, company name, font and email with multiple routes on the same domain:\n\n```terraform\nmodule \"hodovi_cc_maintenance\" {\n  source          = \"git::git@github.com:adinhodovic/terraform-cloudflare-maintenance.git?ref=0.9.2\"\n  cloudflare_zone = \"hodovi.cc\"\n  patterns        = [\"hodovi.cc/maintenance/*\", \"hodovi.cc/example/*\"]\n  company_name    = \"HoneyLogic\"\n  email           = \"support@honeylogic.io\"\n  statuspage_url  = \"https://status.hodovi.cc\"\n  font            = \"Poppins\"\n  logo_url        = \"https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic-blue.original.png\"\n  favicon_url     = \"https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic_-_icon.original.height-80.png\"\n}\n```\n\nUse the enabled flag to enable/disable the Cloudflare route when\nmaintenance starts/ends:\n\n```terraform\nmodule \"hodovi_cc_maintenance\" {\n  source          = \"git::git@github.com:adinhodovic/terraform-cloudflare-maintenance.git?ref=0.9.2\"\n  enabled         = false\n  cloudflare_zone = \"hodovi.cc\"\n  patterns        = [\"hodovi.cc/maintenance/*\"]\n  company_name    = \"HoneyLogic\"\n  email           = \"support@honeylogic.io\"\n  statuspage_url  = \"null\"\n  font            = \"Poppins\"\n  logo_url        = \"https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic-blue.original.png\"\n  favicon_url     = \"https://s3.eu-west-1.amazonaws.com/honeylogic.io/media/images/Honeylogic_-_icon.original.height-80.png\"\n}\n```\n\nExample can be found in examples/root-example.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| terraform | \u003e= 0.13 |\n| cloudflare | \u003e= 5.1.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| cloudflare | \u003e= 5.1.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [cloudflare_workers_route.this](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_route) | resource |\n| [cloudflare_workers_script.this](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_script) | resource |\n| [cloudflare_zones.this](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/data-sources/zones) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| account\\_id | Cloudflare account id | `string` | `null` | no |\n| cloudflare\\_zone | n/a | `string` | n/a | yes |\n| company\\_name | n/a | `string` | n/a | yes |\n| email | The email address to used for support inquiries. | `string` | n/a | yes |\n| enabled | Flag to create/delete the worker route. | `bool` | `true` | no |\n| 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 |\n| font | [Google font](https://fonts.google.com/) that should be used. | `string` | `\"Poppins\"` | no |\n| logo\\_url | The logo to be displayed. | `string` | n/a | yes |\n| patterns | The DNS pattern list to deploy the maintenance page to. | `list(string)` | n/a | yes |\n| statuspage\\_url | The status page address to get updated information. | `string` | `\"null\"` | no |\n| whitelist\\_ips | The IPs that are whitelisted to bypass the maintenance page. | `string` | `\"null\"` | no |\n| whitelist\\_path | The paths that are whitelisted defined with a regex expression to bypass the maintenance page. | `string` | `\"null\"` | no |\n\u003c!-- END_TF_DOCS --\u003e\n\n## Notes\n\nGet fonts from [**Google** fonts](https://fonts.google.com/). Ensure that the Google Font is identical in casing e.g \"PT Sans\" can't be\n\"Pt Sans\" otherwise it'll fail to fetch the font.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadinhodovic%2Fterraform-cloudflare-maintenance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadinhodovic%2Fterraform-cloudflare-maintenance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadinhodovic%2Fterraform-cloudflare-maintenance/lists"}