Skip to main content

subnets

Creates, updates, deletes, gets or lists a subnets resource.

Overview

Namesubnets
TypeResource
Idcloudflare.zero_trust.subnets

Fields

The following fields are returned by SELECT queries:

List subnets response

NameDatatypeDescription
idstring (uuid)The UUID of the subnet. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415)
namestringA user-friendly name for the subnet. (example: IPv4 Cloudflare Source IPs)
commentstringAn optional description of the subnet. (default: , example: example comment, x-stainless-terraform-configurability: computed_optional)
created_atstring (date-time)Timestamp of when the resource was created. (example: 2021-01-25T18:22:34.317854Z)
deleted_atstring (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_networkbooleanIf true, this is the default subnet for the account. There can only be one default subnet per account. (x-stainless-terraform-configurability: computed_optional)
networkstringThe private IPv4 or IPv6 range defining the subnet, in CIDR notation. (example: 100.64.0.0/12)
subnet_typestringThe type of subnet. (cloudflare_source, warp) (example: cloudflare_source)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idname, comment, network, existed_at, address_family, is_default_network, is_deleted, sort_order, subnet_types, per_page, pageLists and filters subnets in an account.
update_cloudflare_sourceexecaccount_id, address_familyUpdates 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
address_familystring
address_familystringIf set, only include subnets in the given address family - v4 or v6
commentstring
existed_atstring (url-encoded-date-time)
is_default_networkboolean
is_deletedboolean
namestringIf set, only list subnets with the given name
networkstring
pagenumber
per_pagenumber
sort_orderstring
subnet_typesstring

SELECT examples

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

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 }}"
}'
;