Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/docs/terraform/tutorial/add-page-rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ In the [Configure HTTPS settings](/terraform/tutorial/configure-https-settings/)

Specifically, you will increase the security level for a URL known to be expensive to render and cannot be cached: `https://www.example.com/expensive-db-call`. Additionally, you will add a redirect from the previous URL used to host this page.

:::note
Terraform code snippets below refer to the v4 SDK only.
:::

## 1. Create a new branch and append the page rule

Create a new branch and append the configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ After proxying a basic website through Cloudflare, you can use Terraform to adju

You will use a new Git branch for the changes and then merge it into the `master` branch before applying. On a team, you might consider using this step as an opportunity for others to review your change before merging and deploying it. You can also integrate Terraform into your CI/CD system to perform tests automatically using another Cloudflare domain.

:::note
Terraform code snippets below refer to the v4 SDK only.
:::

## 1. Create a new branch and append the new zone settings

In this step, modify the Terraform configuration to enable the following settings:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ This tutorial shows you how to get started with Terraform. The tutorial uses an

Before you begin, ensure you have [installed Terraform](/terraform/installing/). You will also need to [create an API Token](/fundamentals/api/get-started/create-token/) with permissions to edit resources for this tutorial.

:::note
Terraform code snippets below refer to the v4 SDK only.
:::

## 1. Define your first Terraform config file

Create an initial Terraform config file, filling in your own values for the [API token](/fundamentals/api/get-started/create-token/), [zone ID](/fundamentals/setup/find-account-and-zone-ids/), [account ID](/fundamentals/setup/find-account-and-zone-ids/), and [domain](/fundamentals/setup/manage-domains/add-site/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Sometimes, you may have to roll back configuration changes. For example, you mig

To revert your configuration, check out the desired branch and ask Terraform to move your Cloudflare settings back in time. If you accidentally brought your site down, consider establishing a good strategy for peer reviewing pull requests rather than merging directly to `master` as done in the tutorials for brevity.

:::note
Terraform code snippets below refer to the v4 SDK only.
:::

## 1. Review your configuration history

Before determining how far back to revert, review the versioned history:
Expand Down
4 changes: 4 additions & 0 deletions src/content/docs/terraform/tutorial/track-history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ provider "cloudflare" {

In this tutorial, you will store your configuration in GitHub where it can be tracked, peer-reviewed, and rolled back to as needed. First, you will remove your credentials from the Terraform config file to prevent committing them to a repository.

:::note
Terraform code snippets below refer to the v4 SDK only.
:::

## 1. Use environment variables for authentication

As a good security practice, remove your Cloudflare credentials from anything that will be committed to a repository. The Cloudflare Terraform provider supports reading the credentials (and other configuration) [from environment variables](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs#schema), as in the following example:
Expand Down
4 changes: 4 additions & 0 deletions src/content/docs/terraform/tutorial/use-load-balancing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ head:

In this tutorial, you will add a second origin for some basic round robining, and then use the [Cloudflare Load Balancing](/load-balancing/) product to fail traffic over as needed. You will also enhance your load balancing configuration through the use of "geo steering" to serve results from an origin server that is geographically closest to your end users.

:::note
Terraform code snippets below refer to the v4 SDK only.
:::

## 1. Add another DNS record for `www`

To get started, add a DNS record for a second web server, located in Asia. The IP address for this server is `198.51.100.15`.
Expand Down