Cloudflare DNS for GitHub Pages (kramnameloc.com)

This Terraform config creates the DNS records needed for GitHub Pages:

Prerequisites

Usage

From this directory:

terraform init
cp terraform.tfvars.example terraform.tfvars

Set your Cloudflare token as an environment variable:

export TF_VAR_cloudflare_api_token="replace-with-your-cloudflare-api-token"

Edit terraform.tfvars and set your real zone ID, then apply:

terraform plan -out tfplan
terraform apply tfplan

Notes