subnets
Creates, updates, deletes, gets or lists a subnets resource.
Overview
| Name | subnets |
| Type | Resource |
| Id | cloudflare.zero_trust.subnets |
Fields
The following fields are returned by SELECT queries:
- list
List subnets response
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The UUID of the subnet. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
name | string | A user-friendly name for the subnet. (example: IPv4 Cloudflare Source IPs) |
comment | string | An optional description of the subnet. (default: , example: example comment, x-stainless-terraform-configurability: computed_optional) |
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) |
is_default_network | boolean | If true, this is the default subnet for the account. There can only be one default subnet per account. (x-stainless-terraform-configurability: computed_optional) |
network | string | The private IPv4 or IPv6 range defining the subnet, in CIDR notation. (example: 100.64.0.0/12) |
subnet_type | string | The type of subnet. (cloudflare_source, warp) (example: cloudflare_source) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | name, comment, network, existed_at, address_family, is_default_network, is_deleted, sort_order, subnet_types, per_page, page | Lists and filters subnets in an account. |
update_cloudflare_source | exec | account_id, address_family | Updates the Cloudflare Source subnet of the given address family |
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. |
address_family | string | |
address_family | string | If set, only include subnets in the given address family - v4 or v6 |
comment | string | |
existed_at | string (url-encoded-date-time) | |
is_default_network | boolean | |
is_deleted | boolean | |
name | string | If set, only list subnets with the given name |
network | string | |
page | number | |
per_page | number | |
sort_order | string | |
subnet_types | string |
SELECT examples
- list
Lists and filters subnets in an account.
SELECT
id,
name,
comment,
created_at,
deleted_at,
is_default_network,
network,
subnet_type
FROM cloudflare.zero_trust.subnets
WHERE account_id = '{{ account_id }}' -- required
AND name = '{{ name }}'
AND comment = '{{ comment }}'
AND network = '{{ network }}'
AND existed_at = '{{ existed_at }}'
AND address_family = '{{ address_family }}'
AND is_default_network = '{{ is_default_network }}'
AND is_deleted = '{{ is_deleted }}'
AND sort_order = '{{ sort_order }}'
AND subnet_types = '{{ subnet_types }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lifecycle Methods
- update_cloudflare_source
Updates the Cloudflare Source subnet of the given address family
EXEC cloudflare.zero_trust.subnets.update_cloudflare_source
@account_id='{{ account_id }}' --required,
@address_family='{{ address_family }}' --required
@@json=
'{
"comment": "{{ comment }}",
"name": "{{ name }}",
"network": "{{ network }}"
}'
;