Skip to content

ZoneHold

Source: src/Cloudflare/Zone/Hold.ts

A Cloudflare zone hold (/zones/{zone_id}/hold) — prevents the zone’s hostname (and optionally its subdomains) from being added to another Cloudflare account while the hold is active.

Zone holds are only available on Enterprise zones. On other plans every create/patch fails with Cloudflare code 1005, surfaced as the typed ZoneHoldsRequireEnterprise error.

Destroying the resource removes the hold. The delete is idempotent — removing a hold that is already gone (or whose zone was deleted out-of-band) succeeds.

Place a hold on a zone

const hold = yield* Cloudflare.ZoneHold("MyHold", {
zoneId: zone.zoneId,
});

Hold the zone and all of its subdomains

yield* Cloudflare.ZoneHold("MyHold", {
zoneId: zone.zoneId,
includeSubdomains: true,
});
import { adopt } from "alchemy/AdoptPolicy";
// A hold carries no ownership markers, so the engine refuses to take
// over a pre-existing hold unless you opt in with `adopt(true)`.
const hold = yield* Cloudflare.ZoneHold("MyHold", {
zoneId: zone.zoneId,
}).pipe(adopt(true));