Zone
The Zone resource lets you manage Cloudflare DNS zones and their configuration settings.
Minimal Example
Section titled “Minimal Example”Create a basic DNS zone with default settings.
import { Zone } from "alchemy/cloudflare";
const zone = await Zone("example-zone", { name: "example.com", type: "full", delete: true, //Default true: Delete's Zone on --destroy});
Enhanced Security Settings
Section titled “Enhanced Security Settings”Configure a zone with strict SSL and enhanced security settings.
const secureZone = await Zone("secure-zone", { name: "secure.example.com", settings: { ssl: "strict", alwaysUseHttps: "on", minTlsVersion: "1.3", tls13: "zrt", },});
Performance Optimization
Section titled “Performance Optimization”Create a zone optimized for performance with HTTP/3 and caching.
const fastZone = await Zone("fast-zone", { name: "fast.example.com", settings: { browserCacheTtl: 7200, brotli: "on", http3: "on", earlyHints: "on", },});
Development Mode
Section titled “Development Mode”Configure a zone for development with specific features enabled.
const devZone = await Zone("dev-zone", { name: "dev.example.com", settings: { developmentMode: "on", websockets: "on", hotlinkProtection: "on", },});