{"id":15757904,"url":"https://github.com/ahmadnassri/terraform-module-cloudflare","last_synced_at":"2026-02-17T12:02:39.774Z","repository":{"id":188147115,"uuid":"678184571","full_name":"ahmadnassri/terraform-module-cloudflare","owner":"ahmadnassri","description":"Terraform module to manage Cloudflare resources","archived":false,"fork":false,"pushed_at":"2025-04-09T14:58:45.000Z","size":44,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T21:10:35.660Z","etag":null,"topics":["github","terraform"],"latest_commit_sha":null,"homepage":"","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/ahmadnassri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ahmadnassri"]}},"created_at":"2023-08-14T00:39:18.000Z","updated_at":"2025-01-24T00:50:48.000Z","dependencies_parsed_at":"2023-08-14T02:43:06.342Z","dependency_job_id":"35642e3b-1728-4b84-a1c1-c6484af93625","html_url":"https://github.com/ahmadnassri/terraform-module-cloudflare","commit_stats":null,"previous_names":["ahmadnassri/terraform-module-cloudflare"],"tags_count":15,"template":false,"template_full_name":"ahmadnassri/template-terraform-module","purl":"pkg:github/ahmadnassri/terraform-module-cloudflare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fterraform-module-cloudflare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fterraform-module-cloudflare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fterraform-module-cloudflare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fterraform-module-cloudflare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmadnassri","download_url":"https://codeload.github.com/ahmadnassri/terraform-module-cloudflare/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmadnassri%2Fterraform-module-cloudflare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29543360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T08:11:05.436Z","status":"ssl_error","status_checked_at":"2026-02-17T08:09:38.860Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["github","terraform"],"created_at":"2024-10-04T09:40:46.448Z","updated_at":"2026-02-17T12:02:39.751Z","avatar_url":"https://github.com/ahmadnassri.png","language":"HCL","funding_links":["https://github.com/sponsors/ahmadnassri"],"categories":[],"sub_categories":[],"readme":"# Cloudflare Terraform Module\n\nan opinionated module for managing Cloudflare resources\n\n[![license][license-img]][license-url]\n[![release][release-img]][release-url]\n\n## Usage\n\n``` tf\nmodule \"cloudflare\" {\n  source = \"github.com/ahmadnassri/terraform-module-cloudflare\"\n\n  account_id = \"xxxxx\"\n\n  defaults = {\n    jump_start = true\n    plan       = \"free\"\n\n    records = {\n      ttl      = 1 # auto\n      proxied  = true\n      priority = null\n    }\n\n    always_online            = true\n    always_use_https         = true\n    automatic_https_rewrites = true\n    brotli                   = true\n    browser_check            = true\n    early_hints              = true\n    zero_rtt                 = true\n    http2                    = true\n    http3                    = true\n    email_obfuscation        = true\n    opportunistic_encryption = true\n    hotlink_protection       = true\n    websockets               = true\n    tls_1_3                  = \"zrt\"\n    cname_flattening         = \"flatten_at_root\"\n    security_level           = \"medium\"\n  }\n\n  zones = local.data.zones\n}\n```\n\n## Inputs\n\n| Name         | Type          | Default | Required | Description                |\n|--------------|---------------|---------|----------|----------------------------|\n| `account_id` | `string`      | `-`     | ✅       | Cloudflare account ID      |\n| `zones`      | `map(object)` | `{}`    | ✅       | a map of zones to manage   |\n| `defaults`   | `object`      | `{}`    | ❌       | default zone configuration |\n\n### `zones`\n\n###### Example\n\n``` tf\nzones = {\n  example.com = {\n    brotli         = false\n    security_level = \"high\"\n    redirects = {\n      all:\n        name: default redirect\n        expression: (http.request.uri wildcard r\"*\")\n        target: https://ahmadnassri.com\n    }\n    records = {\n      \"root\" = {\n        type  = \"A\"\n        name  = \"@\"\n        value = \"127.0.0.1\"\n      }\n      \"gmail\" = {\n        type  = \"MX\"\n        name  = \"@\"\n        value = \"SMTP.GOOGLE.COM\"\n      }\n    }\n  }\n}\n```\n\n### `zones` and `defaults`\n\n| Property | Type | Default | Required | Description |\n|----|----|----|----|----|\n| `jump_start` | `bool` | `true` | ❌ | Automatically scan your DNS records and import them to Cloudflare |\n| `plan` | `string` | `free` | ❌ | one of: `free`, `pro`, `business`, `enterprise` |\n| `always_online` | `bool` | `true` | ❌ | Automatically serve cached pages if the origin is offline |\n| `always_use_https` | `bool` | `true` | ❌ | Automatically redirect all visitors to HTTPS |\n| `automatic_https_rewrites` | `bool` | `true` | ❌ | Automatically rewrite HTTP links to HTTPS |\n| `brotli` | `bool` | `true` | ❌ | Enable Brotli compression |\n| `browser_check` | `bool` | `true` | ❌ | Enable Cloudflare's browser integrity check |\n| `early_hints` | `bool` | `true` | ❌ | Enable HTTP/2 server push |\n| `zero_rtt` | `bool` | `true` | ❌ | Enable HTTP/3 0-RTT support |\n| `http2` | `bool` | `true` | ❌ | Enable HTTP/2 |\n| `http3` | `bool` | `true` | ❌ | Enable HTTP/3 |\n| `email_obfuscation` | `bool` | `true` | ❌ | Automatically obfuscate all email addresses on your website |\n| `opportunistic_encryption` | `bool` | `true` | ❌ | Automatically enable Cloudflare for opportunistic encryption |\n| `hotlink_protection` | `bool` | `true` | ❌ | Automatically enable Cloudflare for hotlink protection |\n| `websockets` | `bool` | `true` | ❌ | Automatically enable Cloudflare for WebSockets |\n| `tls_1_3` | `string` | `zrt` | ❌ | one of: `on`, `off`, `zrt` |\n| `cname_flattening` | `string` | `flatten_at_root` | ❌ | one of: `flatten_all`, `flatten_at_root`, `flatten_none` |\n| `security_level` | `string` | `medium` | ❌ | one of: `off`, `essentially_off`, `low`, `medium`, `high`, `under_attack` |\n| `minify_css` | `bool` | `true` | ❌ | Automatically minify all CSS files for your website |\n| `minify_js` | `bool` | `true` | ❌ | Automatically minify all JavaScript files for your website |\n| `minify_html` | `bool` | `true` | ❌ | Automatically minify all HTML files for your website |\n| `records` | `object` | `{}` | ❌ | DNS records to manage |\n| `redirects` | `object` | `{}` | ❌ | Redirect Rules to manage |\n\n### `records`\n\n| Property | Type | Default | Required | Description |\n|----|----|----|----|----|\n| `name` | string | `-` | ❌ | DNS record name (or @ for the zone apex) |\n| `type` | string | `-` | ❌ | record type |\n| `value` | string | `-` | ❌ | content for the record |\n| `ttl` | number | 1 | ❌ | Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic' |\n| `proxied` | bool | true | ❌ | Whether the record is receiving the performance and security benefits of Cloudflare |\n| `priority` | number | `-` | ❌ | Required for MX, SRV and URI records; unused by other record types |\n\n### `redirects`\n\n| Property | Type | Default | Required | Description |\n|----|----|----|----|----|\n| `name` | `string` | `-` | ❌ | rule name |\n| `expression` | `string` | `-` | ❌ | Firewall Rules expression language |\n| `target` | `string` | `-` | ❌ | The URL to forward to |\n| `status` | `number` | `301` | ✅ | The HTTP status code to use for the rule |\n\n----\n\u003e Author: [Ahmad Nassri](https://www.ahmadnassri.com/) \u0026bull;\n\u003e Twitter: [@AhmadNassri](https://twitter.com/AhmadNassri)\n\n[license-url]: LICENSE\n[license-img]: https://badgen.net/github/license/ahmadnassri/terraform-module-cloudflare\n\n[release-url]: https://github.com/ahmadnassri/terraform-module-cloudflare/releases\n[release-img]: https://badgen.net/github/release/ahmadnassri/terraform-module-cloudflare\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadnassri%2Fterraform-module-cloudflare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmadnassri%2Fterraform-module-cloudflare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmadnassri%2Fterraform-module-cloudflare/lists"}