|
6 | 6 |
|
7 | 7 | ---
|
8 | 8 |
|
9 |
| -import { Render, Tabs, TabItem, Details } from "~/components" |
| 9 | +import { Render, Tabs, TabItem } from "~/components" |
10 | 10 |
|
11 | 11 | Cloudflare Tunnel is an outbound-only daemon service that can run on nearly any host machine and proxies local traffic once validated from the Cloudflare network. User traffic initiated from the WARP endpoint client onramps to Cloudflare, passes down your Cloudflare Tunnel connections, and terminates automatically in your local network. Traffic reaching your internal applications or services will carry the local source IP address of the host machine running the `cloudflared` daemon.
|
12 | 12 |
|
@@ -61,50 +61,7 @@ To connect your private network:
|
61 | 61 | ```
|
62 | 62 |
|
63 | 63 | 5. Get the [token](/cloudflare-one/connections/connect-networks/configure-tunnels/remote-tunnel-permissions/) used to run the tunnel:
|
64 |
| - |
65 |
| - ```tf |
66 |
| - data "cloudflare_zero_trust_tunnel_cloudflared_token" "tunnel_token" { |
67 |
| - account_id = var.cloudflare_account_id |
68 |
| - tunnel_id = cloudflare_zero_trust_tunnel_cloudflared.example_tunnel.id |
69 |
| - } |
70 |
| - ``` |
71 |
| - |
72 |
| - If your host machine is not managed in Terraform or you want to install the tunnel manually, you can output the token value to the CLI. |
73 |
| - <Details header="Example: Output to CLI" open = {false}> |
74 |
| - 1. Output the tunnel token to the Terraform state file: |
75 |
| - ```tf |
76 |
| - output "tunnel_token" { |
77 |
| - value = data.cloudflare_zero_trust_tunnel_cloudflared_token.tunnel_token.token |
78 |
| - sensitive = true |
79 |
| - } |
80 |
| - ``` |
81 |
| - 2. Apply the configuration: |
82 |
| - ```sh |
83 |
| - terraform apply |
84 |
| - ``` |
85 |
| - 3. Read the tunnel token: |
86 |
| - ```sh |
87 |
| - terraform output -raw tunnel_token |
88 |
| - ``` |
89 |
| - ```sh output |
90 |
| - eyJhIj... |
91 |
| - ``` |
92 |
| - |
93 |
| - </Details> |
94 |
| - |
95 |
| - Alternatively, pass `data.cloudflare_zero_trust_tunnel_cloudflared_token.tunnel_token.token` directly into your host's Terraform configuration or store the token in your secret management tool. |
96 |
| - |
97 |
| - <Details header="Example: Store in HashiCorp Vault" open = {false}> |
98 |
| - ```tf |
99 |
| - resource "vault_generic_secret" "tunnel_token" { |
100 |
| - path = "kv/cloudflare/tunnel_token" |
101 |
| -
|
102 |
| - data_json = jsonencode({ |
103 |
| - "TUNNEL_TOKEN" = data.cloudflare_zero_trust_tunnel_cloudflared_token.tunnel_token.token |
104 |
| - }) |
105 |
| - } |
106 |
| - ``` |
107 |
| - </Details> |
| 64 | + <Render file="terraform/get-tunnel-token" product="cloudflare-one" /> |
108 | 65 |
|
109 | 66 | 6. Install `cloudflared` on a host machine in your private network and run the tunnel:
|
110 | 67 |
|
|
0 commit comments