Skip to main content

locations

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

Overview

Namelocations
TypeResource
Idcloudflare.zero_trust.locations

Fields

The following fields are returned by SELECT queries:

Gets Zero Trust Gateway location details response.

NameDatatypeDescription
idstring (example: ed35569b41ce4d1facfe683550f54086)
namestringSpecify the location name. (example: Austin Office Location)
dns_destination_ips_idstringIndicate the identifier of the pair of IPv4 addresses assigned to this location. (default: 0e4a32c6-6fb8-4858-9296-98f51631e8e6, example: 0e4a32c6-6fb8-4858-9296-98f51631e8e6, x-stainless-terraform-configurability: computed_optional)
dns_destination_ipv6_block_idstringSpecify the UUID of the IPv6 block brought to the gateway so that this location's IPv6 address is allocated from the Bring Your Own IPv6 (BYOIPv6) block rather than the standard Cloudflare IPv6 block. (example: b08f7231-d458-495c-98ef-190604c9ee83, x-stainless-terraform-configurability: computed_optional)
client_defaultbooleanIndicate whether this location is the default location.
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
doh_subdomainstringSpecify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. (example: oli3n9zkz5, x-stainless-terraform-configurability: computed)
ecs_supportbooleanIndicate whether the location must resolve EDNS queries.
endpointsobjectConfigure the destination endpoints for this location. (x-stainless-terraform-configurability: optional)
ipstringDefines the automatically generated IPv6 destination IP assigned to this location. Gateway counts all DNS requests sent to this IP as requests under this location. (example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334, x-stainless-terraform-configurability: computed)
ipv4_destinationstringShow the primary destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. (example: 172.64.36.1, x-stainless-terraform-configurability: computed)
ipv4_destination_backupstringShow the backup destination IPv4 address from the pair identified dns_destination_ips_id. This field read-only. (example: 172.64.36.2, x-stainless-terraform-configurability: computed)
networksarraySpecify the list of network ranges from which requests at this location originate. The list takes effect only if it is non-empty and the IPv4 endpoint is enabled for this location. (x-stainless-terraform-configurability: computed_optional)
updated_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlocation_id, account_idGet a single Zero Trust Gateway location.
listselectaccount_idList Zero Trust Gateway locations for an account.
createinsertaccount_id, nameCreate a new Zero Trust Gateway location.
updatereplacelocation_id, account_id, nameUpdate a configured Zero Trust Gateway location.
deletedeletelocation_id, account_idDelete a configured Zero Trust Gateway location.

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.
location_idstring

SELECT examples

Get a single Zero Trust Gateway location.

SELECT
id,
name,
dns_destination_ips_id,
dns_destination_ipv6_block_id,
client_default,
created_at,
doh_subdomain,
ecs_support,
endpoints,
ip,
ipv4_destination,
ipv4_destination_backup,
networks,
updated_at
FROM cloudflare.zero_trust.locations
WHERE location_id = '{{ location_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Create a new Zero Trust Gateway location.

INSERT INTO cloudflare.zero_trust.locations (
client_default,
dns_destination_ips_id,
ecs_support,
endpoints,
name,
networks,
account_id
)
SELECT
{{ client_default }},
'{{ dns_destination_ips_id }}',
{{ ecs_support }},
'{{ endpoints }}',
'{{ name }}' /* required */,
'{{ networks }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Update a configured Zero Trust Gateway location.

REPLACE cloudflare.zero_trust.locations
SET
client_default = {{ client_default }},
dns_destination_ips_id = '{{ dns_destination_ips_id }}',
ecs_support = {{ ecs_support }},
endpoints = '{{ endpoints }}',
name = '{{ name }}',
networks = '{{ networks }}'
WHERE
location_id = '{{ location_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete a configured Zero Trust Gateway location.

DELETE FROM cloudflare.zero_trust.locations
WHERE location_id = '{{ location_id }}' --required
AND account_id = '{{ account_id }}' --required
;