https://github.com/jameswoolfenden/terraform-cloudflare-adblock
This module helps you set up Adblocking for your devices (PC/Mac Android/Apple) using Cloudflare - similar to a PiHole
https://github.com/jameswoolfenden/terraform-cloudflare-adblock
adblock mobile pihole security
Last synced: 9 months ago
JSON representation
This module helps you set up Adblocking for your devices (PC/Mac Android/Apple) using Cloudflare - similar to a PiHole
- Host: GitHub
- URL: https://github.com/jameswoolfenden/terraform-cloudflare-adblock
- Owner: JamesWoolfenden
- License: apache-2.0
- Created: 2023-02-04T18:10:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-06-15T10:10:37.000Z (about 1 year ago)
- Last Synced: 2025-07-04T17:12:53.128Z (12 months ago)
- Topics: adblock, mobile, pihole, security
- Language: HCL
- Homepage:
- Size: 90.8 KB
- Stars: 26
- Watchers: 4
- Forks: 10
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# terraform-cloudflare-adblock
[](https://github.com/JamesWoolfenden/terraform-cloudflare-adblock)
[](https://github.com/JamesWoolfenden/terraform-cloudflare-adblock/releases/latest)
[](https://github.com/JamesWoolfenden/terraform-cloudflare-adblock/releases/latest)

[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=JamesWoolfenden%2Fterraform-cloudflare-adblock&benchmark=CIS+AWS+V1.2)
[](https://github.com/pre-commit/pre-commit)
[](https://www.checkov.io/)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=JamesWoolfenden%2Fterraform-cloudflare-adblock&benchmark=INFRASTRUCTURE+SECURITY)
Terraform module -
This module helps you set up a Cloudflare team for use with the Warp client, enabling Malware protection and Adblocking.
You need to register for an account first and then install the Cloudflare Warp client on the devices you want to protect.
This module does everything else, sets up the block lists and has 2 GHA that keep the list updated and deploy it.
---
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
## Usage
```terraform
module "adblock" {
source = "JamesWoolfenden/adblock/cloudflare"
version = "0.0.1"
team_name = ""
}
```
To run a copy of the Github action (Deploy and Bump), you need to add the env vars to your repository secrets:
CLOUDFLARE_API_KEY
CLOUDFLARE_EMAIL
I'm also using an AWS state file, if you use the same then you'll also need to provide adequate AWS creds and env vars.
Adapted from .
## Requirements
| Name | Version |
|------|---------|
| [cloudflare](#requirement\_cloudflare) | 3.33.1 |
## Providers
| Name | Version |
|------|---------|
| [cloudflare](#provider\_cloudflare) | 3.33.1 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [cloudflare_teams_account.woolfenden](https://registry.terraform.io/providers/cloudflare/cloudflare/3.33.1/docs/resources/teams_account) | resource |
| [cloudflare_teams_list.pihole_domain_lists](https://registry.terraform.io/providers/cloudflare/cloudflare/3.33.1/docs/resources/teams_list) | resource |
| [cloudflare_teams_rule.block_ads](https://registry.terraform.io/providers/cloudflare/cloudflare/3.33.1/docs/resources/teams_rule) | resource |
| [cloudflare_teams_rule.block_malware](https://registry.terraform.io/providers/cloudflare/cloudflare/3.33.1/docs/resources/teams_rule) | resource |
| [cloudflare_accounts.woolfenden](https://registry.terraform.io/providers/cloudflare/cloudflare/3.33.1/docs/data-sources/accounts) | data source |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [logo\_path](#input\_logo\_path) | n/a | `string` | `"https://pbs.twimg.com/profile_images/1408927094315393028/WkL6f1Qf_400x400.jpg"` | no |
| [team\_name](#input\_team\_name) | Your cloudflare team name | `string` | n/a | yes |
## Outputs
| Name | Description |
|------|-------------|
| [account](#output\_account) | n/a |
| [accounts](#output\_accounts) | n/a |
| [malware\_rule](#output\_malware\_rule) | n/a |
| [team](#output\_team) | n/a |
## Policy
This is the policy required to build this project:
and Using
## Keeping the domain list up to date
The `action-update-list.yml` provides a sample
GitHub Actions workflow that periodically (monthly) fetches the list upstream and commits it to the repo if it has changed.

## Related Projects
Check out these related projects.
- [terraform-aws-s3](https://github.com/jameswoolfenden/terraform-aws-s3) - S3 buckets
## Help
**Got a question?**
File a GitHub [issue](https://github.com/JamesWoolfenden/terraform-cloudflare-adblock/issues).
## Contributing
### Bug Reports & Feature Requests
Please use the [issue tracker](https://github.com/JamesWoolfenden/terraform-cloudflare-adblock/issues) to report any bugs or file feature requests.
## Copyrights
Copyright � 2023 James Woolfenden
## License
[](https://opensource.org/licenses/Apache-2.0)
See [LICENSE](LICENSE) for full details.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
### Contributors
[![James Woolfenden][jameswoolfenden_avatar]][jameswoolfenden_homepage]
[James Woolfenden][jameswoolfenden_homepage]
[jameswoolfenden_homepage]: https://github.com/jameswoolfenden
[jameswoolfenden_avatar]: https://github.com/jameswoolfenden.png?size=150