OriginCloudRegion
Source:
src/Cloudflare/Cache/OriginCloudRegion.ts
An origin cloud-region mapping of a Cloudflare zone
(/zones/{zone_id}/cache/origin_cloud_regions).
The mapping tells Cloudflare which public-cloud vendor region hosts a given origin IP, letting Tiered Cache pick an upper-tier data center close to the origin for better cache-fill performance.
A mapping’s identity is its origin IP within the zone — changing ip
(or zoneId) triggers a replacement, while vendor and region are
patched in place. Mappings carry no ownership markers: when there is no
prior state, read reports an existing mapping for the same IP as
Unowned, so the engine refuses to take it over unless --adopt
(or adopt(true)) is set.
Mapping origins to cloud regions
Section titled “Mapping origins to cloud regions”Map an origin IP to an AWS region
const zone = yield* Cloudflare.Zone("Site", { name: "example.com" });
yield* Cloudflare.OriginCloudRegion("ApiOrigin", { zoneId: zone.zoneId, ip: "192.0.2.10", vendor: "aws", region: "us-east-1",});Map several origins of the same zone
// One resource per origin IP — the IP is the mapping's identity.yield* Cloudflare.OriginCloudRegion("UsOrigin", { zoneId: zone.zoneId, ip: "192.0.2.10", vendor: "gcp", region: "us-central1",});yield* Cloudflare.OriginCloudRegion("EuOrigin", { zoneId: zone.zoneId, ip: "192.0.2.20", vendor: "gcp", region: "europe-west1",});