tunnels
Creates, updates, deletes, gets or lists a tunnels resource.
Overview
| Name | tunnels |
| Type | Resource |
| Id | cloudflare.zero_trust.tunnels |
Fields
The following fields are returned by SELECT queries:
- list
List Tunnels response
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | UUID of the tunnel. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
name | string | A user-friendly name for a tunnel. (example: blog) |
account_tag | string | Cloudflare account ID (example: 699d98642c564d2e855e9661899b7252) |
config_src | string | Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard. (local, cloudflare) (default: local, example: cloudflare) |
connections | array | The Cloudflare Tunnel connections between your origin and Cloudflare's edge. (x-stainless-deprecation-message: This field will start returning an empty array. To fetch the connections of a given tunnel, please use the dedicated endpoint /accounts/{account_id}/{tunnel_type}/{tunnel_id}/connections) |
conns_active_at | string (date-time) | Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If null, the tunnel is inactive. (example: 2009-11-10T23:00:00Z) |
conns_inactive_at | string (date-time) | Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If null, the tunnel is active. (example: 2009-11-10T23:00:00Z) |
created_at | string (date-time) | Timestamp of when the resource was created. (example: 2021-01-25T18:22:34.317854Z) |
deleted_at | string (date-time) | Timestamp of when the resource was deleted. If null, the resource has not been deleted. (example: 2009-11-10T23:00:00.000000Z) |
metadata | object | Metadata associated with the tunnel. |
remote_config | boolean | If true, the tunnel can be configured remotely from the Zero Trust dashboard. If false, the tunnel must be configured locally on the origin machine. (x-stainless-deprecation-message: Use the config_src field instead.) |
status | string | The status of the tunnel. Valid values are inactive (tunnel has never been run), degraded (tunnel is active and able to serve traffic but in an unhealthy state), healthy (tunnel is active and able to serve traffic), or down (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). (inactive, degraded, healthy, down) (example: healthy) |
tun_type | string | The type of tunnel. (cfd_tunnel, warp_connector, warp, magic, ip_sec, gre, cni) (example: cfd_tunnel) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | name, is_deleted, existed_at, uuid, was_active_at, was_inactive_at, include_prefix, exclude_prefix, tun_types, status, per_page, page | Lists and filters all types of Tunnels in an account. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
exclude_prefix | string | |
existed_at | string (url-encoded-date-time) | |
include_prefix | string | |
is_deleted | boolean | |
name | string | |
page | number | |
per_page | number | |
status | string | |
tun_types | array | |
uuid | string (uuid) | |
was_active_at | string (date-time) | |
was_inactive_at | string (date-time) |
SELECT examples
- list
Lists and filters all types of Tunnels in an account.
SELECT
id,
name,
account_tag,
config_src,
connections,
conns_active_at,
conns_inactive_at,
created_at,
deleted_at,
metadata,
remote_config,
status,
tun_type
FROM cloudflare.zero_trust.tunnels
WHERE account_id = '{{ account_id }}' -- required
AND name = '{{ name }}'
AND is_deleted = '{{ is_deleted }}'
AND existed_at = '{{ existed_at }}'
AND uuid = '{{ uuid }}'
AND was_active_at = '{{ was_active_at }}'
AND was_inactive_at = '{{ was_inactive_at }}'
AND include_prefix = '{{ include_prefix }}'
AND exclude_prefix = '{{ exclude_prefix }}'
AND tun_types = '{{ tun_types }}'
AND status = '{{ status }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;