---
title: Cache Rules — Terraform example · Cloudflare Cache (CDN) docs
description: The following example defines a single cache rule for a zone using Terraform. The rule configures several cache settings and sets a custom cache key for incoming requests addressed at example.net.
lastUpdated: 2024-12-30T10:34:59.000Z
source_url:
  html: https://c8004c5a.preview.developers.cloudflare.com/cache/how-to/cache-rules/terraform-example/index.md
  md: https://c8004c5a.preview.developers.cloudflare.com/cache/how-to/cache-rules/terraform-example/
---

The following example defines a single cache rule for a zone using Terraform. The rule configures several cache settings and sets a custom cache key for incoming requests addressed at `example.net`.

For additional guidance on using Terraform with Cloudflare, refer to [Terraform](https://developers.cloudflare.com/terraform/).
