Tutorials (6)

Last updated Apr 21, 2026 Before you begin, install Terraform. Each tutorial builds on the previous, so you should complete the tutorials in the order shown below.

Note

If you are upgrading from v4, review the migration guide ↗︎ for breaking changes.

1 – Initialize Terraform

2 – Track your history

  • Store Cloudflare configuration in source control.

3 – Configure HTTPS settings

4 – Improve performance and reliability

5 – Add exceptions with page rules

  • Add page rule.
  • Resource covered: cloudflare_page_rule ↗︎.
  • Increase security level for a specific URL: /expensive-db-call.
  • Add a redirect (URL forward) with a 301 status code from /old-location.php to /expensive-db-call.

6 – Revert configuration

  • Review change history.
  • Roll back changes.

Was this helpful?

YesNo

On this page

Tutorials (6) - 图1Docs

{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/terraform/tutorial/#page","headline":"Tutorials","description":"Step-by-step Cloudflare Terraform tutorials from initialization to advanced configuration.","url":"https://developers.cloudflare.com/terraform/tutorial/","inLanguage":"en","image":"https://developers.cloudflare.com/terraform/tutorial/og.png?v=670d746c3066471a","dateModified":"2026-04-21","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Page Rules let you override zone settings for specific URL patterns. Redirects old URLs with a 301 permanent redirect. title: 5 – Add exceptions with Page Rules image: https://developers.cloudflare.com/terraform/tutorial/add-page-rules/og.png?v=999dfb6ea7145eae


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/terraform/llms.txt
Use this file to discover all available pages before exploring further.