routes
Creates, updates, deletes, gets or lists a routes resource.
Overview
| Name | routes |
| Type | Resource |
| Id | cloudflare.zero_trust.routes |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a tunnel route response
| Name | Datatype | Description |
|---|---|---|
id | string | UUID of the route. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
tunnel_id | string (uuid) | UUID of the tunnel. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
virtual_network_id | string (uuid) | UUID of the virtual network. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
comment | string | Optional remark describing the route. (default: , example: Example comment for this route.) |
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) |
network | string | The private IPv4 or IPv6 range connected by the route, in CIDR notation. (example: 172.16.0.0/16) |
List tunnel routes response
| Name | Datatype | Description |
|---|---|---|
id | string | UUID of the route. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
tunnel_id | string (uuid) | UUID of the tunnel. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
virtual_network_id | string (uuid) | UUID of the virtual network. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415, x-stainless-terraform-configurability: computed_optional) |
tunnel_name | string | A user-friendly name for a tunnel. (example: blog) |
virtual_network_name | string | A user-friendly name for the virtual network. (example: us-east-1-vpc) |
comment | string | Optional remark describing the route. (default: , example: Example comment for this route.) |
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) |
network | string | The private IPv4 or IPv6 range connected by the route, in CIDR notation. (example: 172.16.0.0/16) |
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 |
|---|---|---|---|---|
get | select | account_id, route_id | Get a private network route in an account. | |
list | select | account_id | comment, is_deleted, network_subset, network_superset, existed_at, tunnel_id, route_id, tun_types, virtual_network_id, per_page, page | Lists and filters private network routes in an account. |
create | insert | account_id, network, tunnel_id | Routes a private network through a Cloudflare Tunnel. | |
edit | update | route_id, account_id | Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request. | |
delete | delete | route_id, account_id | Deletes a private network route from an account. | |
create_by_account | exec | ip_network_encoded, account_id, tunnel_id | Routes a private network through a Cloudflare Tunnel. The CIDR in ip_network_encoded must be written in URL-encoded format. |
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. |
ip_network_encoded | string | |
route_id | string | |
comment | string | |
existed_at | string (url-encoded-date-time) | |
is_deleted | boolean | |
network_subset | string | |
network_superset | string | |
page | number | |
per_page | number | |
route_id | string | |
tun_types | array | |
tunnel_id | string (uuid) | |
virtual_network_id | string (uuid) |
SELECT examples
- get
- list
Get a private network route in an account.
SELECT
id,
tunnel_id,
virtual_network_id,
comment,
created_at,
deleted_at,
network
FROM cloudflare.zero_trust.routes
WHERE account_id = '{{ account_id }}' -- required
AND route_id = '{{ route_id }}' -- required
;
Lists and filters private network routes in an account.
SELECT
id,
tunnel_id,
virtual_network_id,
tunnel_name,
virtual_network_name,
comment,
created_at,
deleted_at,
network,
tun_type
FROM cloudflare.zero_trust.routes
WHERE account_id = '{{ account_id }}' -- required
AND comment = '{{ comment }}'
AND is_deleted = '{{ is_deleted }}'
AND network_subset = '{{ network_subset }}'
AND network_superset = '{{ network_superset }}'
AND existed_at = '{{ existed_at }}'
AND tunnel_id = '{{ tunnel_id }}'
AND route_id = '{{ route_id }}'
AND tun_types = '{{ tun_types }}'
AND virtual_network_id = '{{ virtual_network_id }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create
- Manifest
Routes a private network through a Cloudflare Tunnel.
INSERT INTO cloudflare.zero_trust.routes (
comment,
network,
tunnel_id,
virtual_network_id,
account_id
)
SELECT
'{{ comment }}',
'{{ network }}' /* required */,
'{{ tunnel_id }}' /* required */,
'{{ virtual_network_id }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: routes
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the routes resource.
- name: comment
value: "{{ comment }}"
description: |
Optional remark describing the route.
default:
- name: network
value: "{{ network }}"
description: |
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
- name: tunnel_id
value: "{{ tunnel_id }}"
description: |
UUID of the tunnel.
- name: virtual_network_id
value: "{{ virtual_network_id }}"
description: |
UUID of the virtual network.
UPDATE examples
- edit
Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request.
UPDATE cloudflare.zero_trust.routes
SET
comment = '{{ comment }}',
network = '{{ network }}',
tunnel_id = '{{ tunnel_id }}',
virtual_network_id = '{{ virtual_network_id }}'
WHERE
route_id = '{{ route_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Deletes a private network route from an account.
DELETE FROM cloudflare.zero_trust.routes
WHERE route_id = '{{ route_id }}' --required
AND account_id = '{{ account_id }}' --required
;
Lifecycle Methods
- create_by_account
Routes a private network through a Cloudflare Tunnel. The CIDR in ip_network_encoded must be written in URL-encoded format.
EXEC cloudflare.zero_trust.routes.create_by_account
@ip_network_encoded='{{ ip_network_encoded }}' --required,
@account_id='{{ account_id }}' --required
@@json=
'{
"comment": "{{ comment }}",
"tunnel_id": "{{ tunnel_id }}",
"virtual_network_id": "{{ virtual_network_id }}"
}'
;