diff --git a/src/content/docs/cloudflare-one/connections/connect-networks/deploy-tunnels/deployment-guides/terraform.mdx b/src/content/docs/cloudflare-one/connections/connect-networks/deploy-tunnels/deployment-guides/terraform.mdx index 07b47626d84e81f..99b4e4b8e21e3b8 100644 --- a/src/content/docs/cloudflare-one/connections/connect-networks/deploy-tunnels/deployment-guides/terraform.mdx +++ b/src/content/docs/cloudflare-one/connections/connect-networks/deploy-tunnels/deployment-guides/terraform.mdx @@ -82,7 +82,7 @@ You will need to declare the [providers](https://registry.terraform.io/browse/pr required_providers { cloudflare = { source = "cloudflare/cloudflare" - version = ">= 4.39.0" + version = ">= 4.40.0" } google = { source = "hashicorp/google" @@ -91,7 +91,7 @@ You will need to declare the [providers](https://registry.terraform.io/browse/pr source = "hashicorp/random" } } - required_version = ">= 0.13" + required_version = ">= 1.2" } # Providers @@ -126,7 +126,7 @@ The following configuration will modify settings in your Cloudflare account. } # Creates a new locally-managed tunnel for the GCP VM. - resource "cloudflare_tunnel" "auto_tunnel" { + resource "cloudflare_zero_trust_tunnel_cloudflared" "auto_tunnel" { account_id = var.cloudflare_account_id name = "Terraform GCP tunnel" secret = base64sha256(random_password.tunnel_secret.result) @@ -136,14 +136,14 @@ The following configuration will modify settings in your Cloudflare account. resource "cloudflare_record" "http_app" { zone_id = var.cloudflare_zone_id name = "http_app" - content = "${cloudflare_tunnel.auto_tunnel.cname}" + content = "${cloudflare_zero_trust_tunnel_cloudflared.auto_tunnel.cname}" type = "CNAME" proxied = true } # Creates the configuration for the tunnel. - resource "cloudflare_tunnel_config" "auto_tunnel" { - tunnel_id = cloudflare_tunnel.auto_tunnel.id + resource "cloudflare_zero_trust_tunnel_cloudflared_config" "auto_tunnel" { + tunnel_id = cloudflare_zero_trust_tunnel_cloudflared.auto_tunnel.id account_id = var.cloudflare_account_id config { ingress_rule { @@ -154,7 +154,7 @@ The following configuration will modify settings in your Cloudflare account. access { required = true team_name = "myteam" - aud_tag = [cloudflare_access_application.http_app.aud] + aud_tag = [cloudflare_zero_trust_access_application.http_app.aud] } } } @@ -165,7 +165,7 @@ The following configuration will modify settings in your Cloudflare account. } # Creates an Access application to control who can connect. - resource "cloudflare_access_application" "http_app" { + resource "cloudflare_zero_trust_access_application" "http_app" { zone_id = var.cloudflare_zone_id name = "Access application for http_app.${var.cloudflare_zone}" domain = "http_app.${var.cloudflare_zone}" @@ -173,8 +173,8 @@ The following configuration will modify settings in your Cloudflare account. } # Creates an Access policy for the application. - resource "cloudflare_access_policy" "http_policy" { - application_id = cloudflare_access_application.http_app.id + resource "cloudflare_zero_trust_access_policy" "http_policy" { + application_id = cloudflare_zero_trust_access_application.http_app.id zone_id = var.cloudflare_zone_id name = "Example policy for http_app.${var.cloudflare_zone}" precedence = "1" @@ -232,7 +232,7 @@ The following configuration defines the specifications for the GCP virtual machi // Configures the VM to run a startup script that takes in the Terraform variables. metadata_startup_script = templatefile("./install-tunnel.tpl", { - tunnel_token = cloudflare_tunnel.auto_tunnel.tunnel_token + tunnel_token = cloudflare_zero_trust_tunnel_cloudflared.auto_tunnel.tunnel_token }) } ```