locations
Creates, updates, deletes, gets or lists a locations resource.
Overview
| Name | locations |
| Type | Resource |
| Id | cloudflare.zero_trust.locations |
Fields
The following fields are returned by SELECT queries:
- get
- list
Gets Zero Trust Gateway location details response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: ed35569b41ce4d1facfe683550f54086) |
name | string | Specify the location name. (example: Austin Office Location) |
dns_destination_ips_id | string | Indicate 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_id | string | Specify 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_default | boolean | Indicate whether this location is the default location. |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
doh_subdomain | string | Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. (example: oli3n9zkz5, x-stainless-terraform-configurability: computed) |
ecs_support | boolean | Indicate whether the location must resolve EDNS queries. |
endpoints | object | Configure the destination endpoints for this location. (x-stainless-terraform-configurability: optional) |
ip | string | Defines 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_destination | string | Show 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_backup | string | Show 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) |
networks | array | Specify 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_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
Lists Zero Trust Gateway locations response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: ed35569b41ce4d1facfe683550f54086) |
name | string | Specify the location name. (example: Austin Office Location) |
dns_destination_ips_id | string | Indicate 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_id | string | Specify 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_default | boolean | Indicate whether this location is the default location. |
created_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
doh_subdomain | string | Specify the DNS over HTTPS domain that receives DNS requests. Gateway automatically generates this value. (example: oli3n9zkz5, x-stainless-terraform-configurability: computed) |
ecs_support | boolean | Indicate whether the location must resolve EDNS queries. |
endpoints | object | Configure the destination endpoints for this location. (x-stainless-terraform-configurability: optional) |
ip | string | Defines 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_destination | string | Show 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_backup | string | Show 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) |
networks | array | Specify 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_at | string (date-time) | (example: 2014-01-01T05:20:00.12345Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | location_id, account_id | Get a single Zero Trust Gateway location. | |
list | select | account_id | List Zero Trust Gateway locations for an account. | |
create | insert | account_id, name | Create a new Zero Trust Gateway location. | |
update | replace | location_id, account_id, name | Update a configured Zero Trust Gateway location. | |
delete | delete | location_id, account_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
location_id | string |
SELECT examples
- get
- list
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
;
List Zero Trust Gateway locations for an account.
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 account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: locations
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the locations resource.
- name: client_default
value: {{ client_default }}
description: |
Indicate whether this location is the default location.
default: false
- name: dns_destination_ips_id
value: "{{ dns_destination_ips_id }}"
description: |
Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged.
- name: ecs_support
value: {{ ecs_support }}
description: |
Indicate whether the location must resolve EDNS queries.
default: false
- name: endpoints
description: |
Configure the destination endpoints for this location.
value:
doh:
enabled: {{ enabled }}
networks:
- network: "{{ network }}"
require_token: {{ require_token }}
dot:
enabled: {{ enabled }}
networks:
- network: "{{ network }}"
ipv4:
enabled: {{ enabled }}
ipv6:
enabled: {{ enabled }}
networks:
- network: "{{ network }}"
- name: name
value: "{{ name }}"
description: |
Specify the location name.
- name: networks
description: |
Specify 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.
value:
- network: "{{ network }}"
REPLACE examples
- update
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
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
;