Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 1.55 KB

README.md

File metadata and controls

47 lines (40 loc) · 1.55 KB

Cloudflare

The intent of this repo is to demonstrate how to manage Cloudflare configurations using Terraform and GitHub Actions for CI/CD.

Usage

  • Check providers using terraform providers
  • Initialize Terraform: Run terraform init in your working directory to download necessary plugins.
  • Plan Changes: Use terraform plan --var-file team1.tfvars to see what changes will be made.
  • Apply Configuration: Deploy your setup with terraform apply --var-file team1.tfvars.

Repo structure for modularity with multiple teams being able to 'self-serve'

  ├── .github/
  │   └── workflows/
  │       └── ci-cd.yml
  ├── terraform/
  │   ├── main.tf
  │   ├── variables.tf
  │   ├── outputs.tf
  │   ├── provider.tf
  │   ├── team1.auto.tfvars
  │   └── team2.auto.tfvars
  └── README.md

Commands

Verify Validity of API Token

curl -X GET "https://api.cloudflare.com/client/v4/accounts/<account_id>/tokens/verify" \
     -H "Authorization: Bearer <api_token>" \
     -H "Content-Type:application/json"

Permissions Required for API Token

Type Permission Mode
Account Cloudflare Tunnel Edit
Account Zero Trust Edit
Account DNS Firewall Edit
Account Access: Apps and Policies Edit
Account Account Firewall Access Rules Edit
Account Access: Apps and Policies Edit
Account Account Firewall Access Rules Read
Account Access: Apps and Policies Read
Zone DNS Edit