origin_cloud_regions
Creates, updates, deletes, gets or lists an origin_cloud_regions resource.
Overview
| Name | origin_cloud_regions |
| Type | Resource |
| Id | cloudflare.cache.origin_cloud_regions |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get origin cloud region mapping response.
| Name | Datatype | Description |
|---|---|---|
id | string | (origin_public_cloud_region) (example: origin_public_cloud_region) |
editable | boolean | Whether the setting can be modified by the current user. |
modified_on | string (date-time) | Time the mapping was last modified. |
value | object | A single origin IP-to-cloud-region mapping. |
List origin cloud region mappings response.
| Name | Datatype | Description |
|---|---|---|
id | string | (origin_public_cloud_region) (example: origin_public_cloud_region) |
editable | boolean | Whether the setting can be modified by the current user. |
modified_on | string (date-time) | Time the mapping set was last modified. Null when no mappings exist. |
value | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | zone_id, origin_ip | Returns the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 (code 1142) if the zone has no mappings or if the specified IP has no mapping. | |
list | select | zone_id | Returns all IP-to-cloud-region mappings configured for the zone. Each mapping tells Cloudflare which cloud vendor and region hosts the origin at that IP, enabling the edge to route via the nearest Tiered Cache upper-tier co-located with that cloud provider. Returns an empty array when no mappings exist. | |
origin_cloud_regions_create | insert | zone_id, ip, vendor, region | Adds a single IP-to-cloud-region mapping for the zone. The IP must be a valid IPv4 or IPv6 address and is normalized to canonical form before storage (RFC 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists — use PATCH to update an existing entry. The vendor and region are validated against the list from GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions. | |
origin_cloud_regions_upsert | update | zone_id, ip, vendor, region | Adds or updates a single IP-to-cloud-region mapping for the zone. Unlike POST, this operation is idempotent — if a mapping for the IP already exists it is overwritten. Returns the complete updated list of all mappings for the zone. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings. | |
origin_cloud_regions_delete | delete | zone_id, origin_ip | Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted entry on success. Returns 404 (code 1163) if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted. |
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 |
|---|---|---|
origin_ip | string | Origin IP address whose mapping should be deleted. |
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- get
- list
Returns the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 (code 1142) if the zone has no mappings or if the specified IP has no mapping.
SELECT
id,
editable,
modified_on,
value
FROM cloudflare.cache.origin_cloud_regions
WHERE zone_id = '{{ zone_id }}' -- required
AND origin_ip = '{{ origin_ip }}' -- required
;
Returns all IP-to-cloud-region mappings configured for the zone. Each mapping tells Cloudflare which cloud vendor and region hosts the origin at that IP, enabling the edge to route via the nearest Tiered Cache upper-tier co-located with that cloud provider. Returns an empty array when no mappings exist.
SELECT
id,
editable,
modified_on,
value
FROM cloudflare.cache.origin_cloud_regions
WHERE zone_id = '{{ zone_id }}' -- required
;
INSERT examples
- origin_cloud_regions_create
- Manifest
Adds a single IP-to-cloud-region mapping for the zone. The IP must be a valid IPv4 or IPv6 address and is normalized to canonical form before storage (RFC 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists — use PATCH to update an existing entry. The vendor and region are validated against the list from GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions.
INSERT INTO cloudflare.cache.origin_cloud_regions (
ip,
region,
vendor,
zone_id
)
SELECT
'{{ ip }}' /* required */,
'{{ region }}' /* required */,
'{{ vendor }}' /* required */,
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: origin_cloud_regions
props:
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the origin_cloud_regions resource.
- name: ip
value: "{{ ip }}"
description: |
Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage (RFC 5952 for IPv6).
- name: region
value: "{{ region }}"
description: |
Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported_regions endpoint.
- name: vendor
value: "{{ vendor }}"
description: |
Cloud vendor hosting the origin. Must be one of the supported vendors.
valid_values: ['aws', 'azure', 'gcp', 'oci']
UPDATE examples
- origin_cloud_regions_upsert
Adds or updates a single IP-to-cloud-region mapping for the zone. Unlike POST, this operation is idempotent — if a mapping for the IP already exists it is overwritten. Returns the complete updated list of all mappings for the zone. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings.
UPDATE cloudflare.cache.origin_cloud_regions
SET
ip = '{{ ip }}',
region = '{{ region }}',
vendor = '{{ vendor }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND ip = '{{ ip }}' --required
AND vendor = '{{ vendor }}' --required
AND region = '{{ region }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- origin_cloud_regions_delete
Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted entry on success. Returns 404 (code 1163) if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.
DELETE FROM cloudflare.cache.origin_cloud_regions
WHERE zone_id = '{{ zone_id }}' --required
AND origin_ip = '{{ origin_ip }}' --required
;