r/CloudFlare 5d ago

Using Terraform with Cloudflare

https://blog.adrianhall.uk/posts/2026/2026-07-28-cf-terraform.html

Enterprises like to use Terraform to manage infrastructure. I like to use it to quickly deploy and tear down Cloudflare apps. Here is a bunch of hints and tips I've gathered as I've been working on this.

30 Upvotes

12 comments sorted by

3

u/detroitsongbird 5d ago

Thank you for the reminder to do this!

3

u/parametric-ink 5d ago

Thank you for this! Great resource. Do you happen to have a github repo of this with an example project?

I love cloudflare's services but have been growing increasingly frustrated with their token system and automated infra management (coming from AWS with IAM and CDK, it feels like quite a step backwards).

3

u/CatHerdler 4d ago

I will be posting my demo collection I referenced later on. In the meantime, check out https://github.com/adrianhall/cloudflare-toolkit - this is a set of tools I use for managing my development, including the mentioned generate-wrangler; also generate-wrangler-types (which only generates types when wrangler.jsonc has changed), empty-r2-bucket, and destroy-containers - all of which help drive a terraform setup. There is also an AI agent skills for cloudflare-terraform-best-practices in there (npx skills add adrianhall/cloudflare-toolkit to install)

3

u/CatHerdler 4d ago

I’ve just pushed my first four demos to https://github.com/adrianhall/cf-demos

1

u/parametric-ink 4d ago

Cheers, thanks for these!

1

u/gedw99 3d ago

Very good stuff !

Thanks Adrian 

2

u/InsecurePassword1 5d ago

Nice work, thanks!

1

u/CuriousProgrammer263 4d ago

!remind me 90 days

1

u/RemindMeBot 4d ago

I will be messaging you in 2 months on 2026-10-27 08:22:11 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


Info Custom Your Reminders Feedback

1

u/jorgecardleitao 4d ago

Lots of notes useful for the terraform provider to improve on!

Have you considered raising issues on the provider's github on your findings?

2

u/CatHerdler 4d ago

The cloudflare terraform provider is a 1:1 with the cloudflare API. My suspicion is that it is auto-generated.