Back to Cloudflare

Manage Cloudflare With APIs and Infrastructure as Code

November 5, 2026 Wasil Zafar 25 min read

Make permissions, ownership, state, and drift explicit

Table of Contents

  1. Tokens and SDKs Need Explicit Resource Scope
  2. Wrangler and IaC Should Not Fight Over Ownership
  3. Terraform and Pulumi Model Resource Lifecycles
  4. Importing Existing Resources and Reviewing Drift
  5. Design a Reproducible Zone and Worker Configuration
  6. Review a Change Plan and Show a Clean No-Op Recheck

Tokens and SDKs Need Explicit Resource Scope

A deploy script works on a laptop and fails in CI with Authentication error. The code is unchanged; the credential is not. The laptop likely used a personal token with broad access, while CI received a token for another account or one that can edit DNS but not Workers. That is a scope bug, and it is the first thing to make explicit.

Think of a hotel key card. It encodes three separate facts: who you are, which doors you may open, and when the card stops working. A Cloudflare API token is that card: a permission set, a resource boundary, and optional restrictions such as an expiry time or an IP range.

Vocabulary first:

The credential type decides who the token acts for and whether it survives a staff change:

CredentialActs asSurvives staff changesPrefixBest for
User API tokenThe person who created it, with a subset of their permissionsNo — revoked when the person leaves or changes rolecfut_Local checks and short-lived personal automation
Account-owned tokenA service principal, independent of any one personYescfat_CI pipelines and long-lived integrations

The secret is shown once at creation. Cloudflare publishes a compatibility matrix because some products do not support account-owned tokens yet.

An SDK wraps the REST API; Cloudflare publishes Go, TypeScript, and Python SDKs. Infrastructure as code (IaC) is a declarative description of desired resources plus a tool that compares it with reality. State maps a configuration address such as cloudflare_dns_record.demo to a remote object ID and last-read attributes. Drift is any difference among state, configuration, and the live resource. Idempotency means repeating a request produces the same end state as sending it once.

The mental model is a chain: principal → permission → resource scope → secret handling → transport → rate limit. Each link can reject independently. Figure 1 shows where.

Tokens and SDKs Need Explicit Resource Scope
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    U[Operator or CI job] -->|Bearer token| V{Token valid and unexpired?}
    V -- no --> E401[401 authentication error]
    V -- yes --> P{Permission group allows the verb?}
    P -- no --> E403[403 authorization error]
    P -- yes --> S{Resource is inside token scope?}
    S -- no --> E403
    S -- yes --> API[Cloudflare API v4]
    API --> L{Rate limit available?}
    L -- no --> E429[429 and retry-after]
    L -- yes --> OK[Change accepted]
    classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
    classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
    classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
    classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
    classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
    class S,API primary;
    class U,L,E429,OK secondary;
    class P ok;
    class V,E401,E403 danger;

A valid token can still be the wrong token

Granting Zone DNS Edit on all zones when the job needs one is over-scoped. Giving CI a personal token is fragile: it disappears when the employee changes roles. Start with the smallest permission set that passes, scope it to named resources, set a TTL, and put the secret in the CI secret store rather than a repository variable. For a service integration, prefer an account-owned token.

Figure 2 separates the layers so a failure can be assigned to the right one: the secret store, the token policy, the API, and the account/zone/resource hierarchy.

Token scope and request boundary A request leaves a CI secret store, is constrained by a token policy, and reaches only resources inside the token's account and zone boundary. A request outside the boundary is rejected with 403. CI secret store token injected at run never committed API token policy verb: DNS Edit scope: one zone limits: TTL and IP type: user or account Cloudflare API boundary Account Zone DNS record Outside scope: 403, even with a valid token Same zone, different permission: also 403

SDKs are convenience, not a different security model. A typed SDK signs the same requests with the same token and hits the same limits as curl; use it to chain calls, handle typed errors, or integrate with an application. Cloudflare's SDKs read the rate-limit headers and back off automatically.

The documented global limit is 1,200 requests per five minutes per user or per account token, plus 200 requests per second per IP. Exceeding it blocks calls for five minutes and returns HTTP 429 with a retry-after header (rate limits). A large Terraform plan can read hundreds of resources, so a pipeline that also polls the API aggressively can throttle itself.

Retries need care. Cloudflare documents Idempotency-Key for specific endpoints, such as account creation, not as a blanket guarantee for every POST. Treat create calls as non-idempotent unless the endpoint says otherwise; that explains most duplicate-resource incidents later.

Wrangler and IaC Should Not Fight Over Ownership

Two people editing the same document without ownership rules produce a predictable result: each save silently removes the other's work. Wrangler and an IaC tool can do the same to a Worker. The fix is to assign ownership per object, in writing, rather than to pick one tool forever.

Give each object exactly one owner, in writing. Suppose you need to move www.example.com to a new origin and route traffic through a Worker. Wrangler should bundle the code, upload a version, and shift the deployment. Terraform or Pulumi should own the DNS record and the Worker's identity. Give the route one owner: either the IaC tool or Wrangler's routes configuration, never both. If both tools also set the same route or compatibility_date, the last writer wins. Cloudflare's Workers IaC documentation explicitly supports the split: manage only the cloudflare_worker resource with Terraform and keep Wrangler for versions and deployments.

The table compares responsibilities, not brands.

ConcernWranglerTerraformPulumi
Primary jobBundle, upload, and deploy Worker code; manage versions and trafficDeclare and reconcile Cloudflare resources from HCLDeclare and reconcile Cloudflare resources from a general-purpose language
Unit of changeA version and a deploymentA resource address in stateA resource in a stack
Previewwrangler deploy --dry-run for the bundleterraform plan, with -detailed-exitcode for automationpulumi preview, with --expect-no-changes for automation
State and historyDeployment and version history in CloudflareLocal or remote state file; lock file pins providersStack state in a backend; encrypted secrets; plugin versions
Code bundlingBuilt inNone; bundle before upload or let Wrangler buildNone; bundle in your program or pipeline
Best fitWorker code, gradual releases, rollbackDNS, zones, routes, account resources, policyTeams already using TypeScript, Python, Go, or .NET for infrastructure

Figure 3 shows the decision and the two failure paths: overlapping ownership and an unrecorded emergency change.

Wrangler and IaC Should Not Fight Over Ownership
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    A[Change requested] --> B{Which object changes?}
    B -->|Worker code or version| C[Wrangler]
    B -->|Worker shell, DNS, IaC route| D[Terraform or Pulumi]
    B -->|Emergency hotfix| E[Dashboard or API]
    C --> F[Upload version and deploy]
    D --> G[Preview or plan, then apply]
    E --> H[Out-of-band change]
    H --> I{Recorded in code and state?}
    I -- no --> J[Drift or orphaned resource]
    I -- yes --> K[Next plan reverts or conflicts]
    F --> L{Also managed by IaC?}
    L -- yes --> M[Overlapping ownership]
    L -- no --> N[Clean deploy]
    classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
    classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
    classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
    classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
    classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
    class G,I primary;
    class A,B,C,D,E,F,H,L,M secondary;
    class N ok;
    class K danger;
    class J warn;

The two panels show the same boundary in two dialects. The bash panel has Terraform create the Worker shell and DNS record, then Wrangler deploy the code and its route. The TypeScript panel expresses the IaC half in Pulumi.

 # Prereqs: CLOUDFLARE_API_TOKEN with Zone DNS Edit, Zone Workers Routes Edit,
 # and Account Workers Scripts Edit. Export CLOUDFLARE_ACCOUNT_ID and
 # CLOUDFLARE_ZONE_ID, and replace the example hostnames with your own.
set -euo pipefail
mkdir -p cf-ownership-demo && cd cf-ownership-demo

cat > main.tf <<'HCL'
terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "~> 5.28"
    }
  }
}

provider "cloudflare" {}

variable "account_id" { type = string }
variable "zone_id"    { type = string }

resource "cloudflare_worker" "demo" {
  account_id = var.account_id
  name       = "iac-ownership-demo"
}

resource "cloudflare_dns_record" "demo" {
  zone_id = var.zone_id
  name    = "iac-demo.example.com"
  type    = "A"
  content = "192.0.2.10"
  proxied = true
  ttl     = 300
  comment = "Terraform owns DNS; Wrangler owns code and route"
}
HCL

export TF_VAR_account_id="$CLOUDFLARE_ACCOUNT_ID"
export TF_VAR_zone_id="$CLOUDFLARE_ZONE_ID"
terraform init
terraform plan -out=tfplan
terraform apply tfplan

mkdir -p src
cat > wrangler.jsonc <<'JSONC'
{
  "$schema": "node_modules/wrangler/config-schema.json",
  "name": "iac-ownership-demo",
  "main": "src/index.ts",
  "compatibility_date": "2026-11-05",
  "routes": [
    { "pattern": "iac-demo.example.com/*", "zone_name": "example.com" }
  ]
}
JSONC

cat > src/index.ts <<'TS'
export default {
  async fetch(): Promise<Response> {
    return new Response("code owned by Wrangler\n");
  },
};
TS

npx wrangler deploy
terraform plan -detailed-exitcode
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const cfg = new pulumi.Config();
const accountId = cfg.require("accountId");
const zoneId = cfg.require("zoneId");

// Pulumi owns the Worker shell and DNS record.
// Wrangler owns the code, version, and deployment.
const worker = new cloudflare.Worker("iac-ownership-demo", {
  accountId,
  name: "iac-ownership-demo",
  observability: { enabled: true },
});

const record = new cloudflare.DnsRecord("iac-demo", {
  zoneId,
  name: "iac-demo.example.com",
  type: "A",
  content: "192.0.2.10",
  proxied: true,
  ttl: 300,
  comment: "Pulumi owns DNS and the Worker shell",
});

export const workerName = worker.name;
export const recordId = record.id;

Configure the Pulumi stack before the first preview. The provider reads the token from stack config locally and from the CLOUDFLARE_API_TOKEN environment variable in CI.

# Install the provider in the Pulumi project.
npm install @pulumi/cloudflare

# Non-secret IDs live in ordinary stack config.
pulumi config set accountId "$CLOUDFLARE_ACCOUNT_ID"
pulumi config set zoneId "$CLOUDFLARE_ZONE_ID"

# The token stays encrypted in stack state, not in a committed file.
pulumi config set --secret cloudflare:apiToken "$CLOUDFLARE_API_TOKEN"

pulumi up

Now the boundary that is easy to blur: API, IaC, or dashboard.

SurfaceUse it forOwnership recordFailure mode
DashboardExploration, one-off inspection, and emergencies when the pipeline itself is brokenNone; a change to a managed object becomes driftCodify it the same working day or lose it to the next apply
REST API or SDKGlue, custom tooling, application integration, cache purges, analytics queriesNone; a request leaves no intentGood escape hatch, poor owner
Terraform or PulumiDurable ownership of DNS, routes, Workers, and account policy that should exist in every environmentConfiguration, state, review, and historyNeeds plan discipline and drift review

Coverage is still not universal. Terraform plan and Pulumi preview work for resources the provider models, and Cloudflare's v5 provider is generated from the API's OpenAPI schemas, which broadened coverage considerably. Some Workers resources are explicitly beta. A clean plan proves that the modeled attributes match the configuration; it does not prove that every setting in the dashboard matches your intent.

Terraform and Pulumi Model Resource Lifecycles

Both tools implement the same loop: read configuration, refresh state from the API, compute a diff, show it, and apply it. Terraform stores the map in a state file; Pulumi stores it in a stack with a pluggable backend. State is a cache of remote IDs and last-read attributes, not the source of truth.

State is a liability, not a backup

Terraform does not encrypt state by default, so a committed terraform.tfstate can leak secrets or private configuration. Use an encrypted, locked remote backend, restrict readers, and commit only configuration and the lock file. Pulumi encrypts secret values in state, but the backend and stack access policy still need to be production infrastructure.

Locking matters because two concurrent applies can decide to create the same object, and one loses. That is a coordination failure, not a merge conflict.

Pin the provider and commit the lock file. A Terraform constraint such as ~> 5.28 accepts 5.28 and later 5.x releases but not 6.0; = 5.28.1 is an exact pin. Committing the provider lock file makes every machine resolve the same build and checksums, and the Pulumi side should pin its provider version in the project. Upgrades then become a reviewed change: read the upgrade guide, plan in a branch, and inspect replacements before production.

The v4 to v5 Terraform transition is the concrete example. V5 was a ground-up rewrite: tf-migrate rewrites configuration and generates moved blocks, and state upgraders in v5.19 and later handle much of the state side.

Changev4 formv5 formHandle with
DNS record resourcecloudflare_recordcloudflare_dns_recordtf-migrate
Record value attributevaluecontenttf-migrate
Resource type names—More than 40 renamedtf-migrate
State addressesv4 addressesv5 addressesState upgraders in v5.19 and later

A team that pins and upgrades deliberately gets a boring migration; a team that floats on the latest version gets a surprise replacement.

Idempotency, retries, and rate limits intersect most sharply during a partial apply. An apply creates a DNS record, receives success, then fails before writing the ID to state. The resource exists; the state does not know it, so the next apply tries to create it again, producing a duplicate, a conflict, or a silent second object. Stop, inspect the remote object, and import it rather than re-running blindly. A provider retry after an unknown outcome is a new decision, not a replay.

The same lifecycle creates the cleanup problem. A destroy deletes what the state owns; it cannot delete what the state never knew about. That is why an unmanaged DNS record or Worker can outlive its team, keep serving traffic, and keep appearing on a bill. Use prevent_destroy in Terraform or the protect resource option in Pulumi for stateful resources, and treat state loss as an incident rather than a fresh start.

Importing Existing Resources and Reviewing Drift

Import brings a resource created in the dashboard, by curl, or by a predecessor's script into managed ownership. You write the configuration address, supply the remote ID, and the tool writes the mapping into state. Import does not write configuration or make the remote object match it; it only teaches the state the object's identity.

The IDs follow the resource hierarchy. A DNS record imports by zone and record ID; a Workers route by zone and route ID; a Worker version by account, Worker, and version. Terraform 1.5 and later also supports an import block, and -generate-config-out writes HCL for imported resources not yet in configuration; HashiCorp labels that generation experimental, so review the result.

# DNS record: <zone_id>/<dns_record_id>
terraform import cloudflare_dns_record.demo "$CLOUDFLARE_ZONE_ID/<dns_record_id>"

# Workers route: <zone_id>/<route_id>
terraform import cloudflare_workers_route.demo "$CLOUDFLARE_ZONE_ID/<route_id>"

# Worker version: <account_id>/<worker_id>/<version_id>
terraform import cloudflare_worker_version.demo \
  "$CLOUDFLARE_ACCOUNT_ID/<worker_id>/<version_id>"

# Bulk path for an existing zone.
cf-terraforming generate --zone "$CLOUDFLARE_ZONE_ID"
cf-terraforming import --zone "$CLOUDFLARE_ZONE_ID"

# Pulumi maps the object; you still own the program.
pulumi import cloudflare:index/dnsRecord:DnsRecord example \
  "$CLOUDFLARE_ZONE_ID/<dns_record_id>"

Figure 4 shows the before/after state and the failure branch that catches most first imports: the configuration does not match the remote object, so the first plan proposes a replacement rather than a no-op.

Import and drift review Before import, a remote DNS record exists with no state. Import writes the mapping. If configuration matches, plan is a no-op; if it does not, plan proposes a replacement. Before import Created in dashboard or by curl remote DNS record exists Terraform state no address, no ID unmanaged import ID + config After import Configuration desired attributes State address to remote ID Remote resource DNS record in the zone refresh Same attributes: plan shows no changes Different attributes: plan shows update or replace Failure branch Config differs from remote First plan proposes a replacement Review before applying

Drift review is a decision, not a reflex. A plan that shows a difference has three legitimate responses.

Accept the remote value if the out-of-band change was correct: update the configuration, or run a refresh-only apply to record the new attributes in state before changing code.

Enforce the configuration if the remote change was unauthorized: apply the plan, understanding that some attributes force replacement.

Forget the resource if it should no longer be managed: remove it from state and configuration deliberately, rather than deleting it from the dashboard and leaving a stale address.

Import writes identity, not configuration

An import with a mismatched configuration can replace a live record, and a wrong ID can attach state to the wrong object. Review the first plan after every import before applying it.

Cloudflare's Terraform guidance warns that state can break when the same resources change through Terraform and the dashboard or API. Keep plan review and ownership real; this is not a reason to avoid IaC.

Design a Reproducible Zone and Worker Configuration

This is a design-only exercise; no commands were executed and no measured result is reported. It uses an existing zone so that nameserver delegation is out of scope, and it keeps every resource on free-tier-eligible products. Verify current plan availability, Workers limits, and pricing before running it.

Guided exercise

Design a Reproducible Zone and Worker Configuration

Status: design-only, not executed.

Prerequisites. An existing zone you control, its account and zone IDs, Terraform 1.5 or later, and Wrangler 4.x with Node 20 or later. One token, scoped to that account and zone, carries Zone DNS Edit, Zone Workers Routes Edit, and Account Workers Scripts Edit. Store it in a secret manager, never in the repository.

What you build.

PieceOwnerContents
Terraform directoryTerraformPinned cloudflare/cloudflare provider, a cloudflare_worker shell named iac-lab-worker, and a proxied cloudflare_dns_record for iac-lab.<your-zone>
Worker directoryWranglerwrangler.jsonc with the same Worker name, a route for iac-lab.<your-zone>/*, a compatibility_date, and one TypeScript handler
The routeExactly one of the twoDeclared once, either in Wrangler or in the IaC configuration

Steps.

StepActionConfirm
1Export the token and the account and zone IDs, then verify the token at /user/tokens/verifyThe call succeeds; no 401 or 403
2Run terraform init and commit .terraform.lock.hclThe pinned 5.x provider resolved
3If the record exists, add an import block with the zone/record ID and plan with config generationHCL reconciled by hand
4Run terraform plan -out=tfplanEvery create, update, and replace read; no duplicate record
5Run terraform apply tfplanWorker shell and DNS record exist
6From the Worker directory, run npx wrangler deployThe route binds to the new Worker
7Run terraform plan -detailed-exitcodeExit code 0
8Change only the DNS comment in the dashboard, wait, then plan againExit code 2 and a one-attribute in-place update; accept or revert it

Expected observations. The apply creates the Worker shell and DNS record; the deploy creates a version, deployment, and route; the route serves the Worker; a clean plan exits 0; the comment change produces a one-attribute diff. These are expected outcomes, not measurements.

Failure checks.

SymptomLikely causeResponse
403 on route creationToken lacks Workers Routes Edit, or the hostname is not proxiedRescope the token or proxy the hostname
409 or duplicate recordWrong import ID or missing recordRecheck the ID; import before the next apply
State lock errorAnother apply holds the lockConfirm no apply is running before touching the lock
Proposed replacementAn immutable attribute changedRead the diff before applying

Cost dimensions. DNS, routes, and a minimal Worker fit free-tier plans at the time of writing, but request volume, plan tier, and add-ons determine the bill. Verify current limits and pricing before production traffic; no paid load balancer, certificate, or enterprise product is required.

Cleanup. Run npx wrangler delete --name iac-lab-worker to remove the Worker and its route, then terraform destroy to remove the DNS record. If destroy reports the Worker already gone, remove it from state. Confirm no record or route remains, delete the state file and plan, and revoke the lab token.

Review a Change Plan and Show a Clean No-Op Recheck

The evidence standard: explicit ownership and a genuinely clean second run.

Pass/fail evidence.

  • Pass: every managed resource has one declared owner, written down.
  • Pass: the CI token is scoped, TTL-bound, and stored outside the repository.
  • Pass: provider version and lock file are pinned, and upgrades get a plan review.
  • Pass: state is encrypted, access-controlled, and locked during applies.
  • Pass: a second plan reports no changes, and the exit status reflects that.
  • Pass: drift is resolved by an explicit decision, not by re-running apply until the diff disappears.
  • Fail: the same route, record, or Worker setting is declared in both Wrangler and IaC.
  • Fail: terraform apply is the first response to an unknown partial failure.
  • Fail: a clean plan is treated as proof that unmanaged resources and unmodeled settings are correct.

Treat the exit status as the gate, not the text output. -detailed-exitcode returns 0 for an empty diff, 1 on error, and 2 when changes are present, so CI can fail on 2 without parsing text. On the Pulumi side, --expect-no-changes errors if the preview proposes any change.

Either gate is still not a substitute for the plan. A plan can be empty because the configuration is correct, or because the provider did not model the attribute. Pair the gate with a scheduled drift check that alerts on a difference.

Self-check.

A token has Zone DNS Edit on example.com, but the API returns 403 for a Workers route. Why? Permission and scope are separate checks. The token has the DNS verb on the right zone but not the Workers Routes verb; broader DNS permission does not help.

Terraform created a DNS record, then failed before writing state. What should you do before the next apply? Stop and inspect the remote object, then import it with the <zone_id>/<dns_record_id> ID and plan again. Re-applying first can duplicate or conflict, and a retry does not make the create idempotent.

A dashboard change is reverted by the next apply. Is that a bug? No. Terraform is authoritative for managed attributes; the change was drift. Codify the intended value through the pipeline, or stop managing that attribute. The fix is a break-glass procedure, not a weaker plan.

Unresolved limitations. This article was not lab-executed; every command and expected observation is a design, not a measurement. Cloudflare's surface changes faster than provider coverage, and some resources remain beta or have incomplete read behavior. Plan availability, limits, and pricing must be rechecked at run time. Import does not repair mismatched configuration, and state security depends on the backend. Rate limits are shared by every job using the same token, so parallel applies and monitoring interfere. Transport retries reduce transient failures but cannot guarantee exactly-once creation after an unknown outcome.

Verification note. Planning baseline: 2026-11-02. Verification date: 2026-11-05. Registry and release metadata checked on that date: Cloudflare Terraform provider 5.28.1, Pulumi Cloudflare provider 6.23.2, Cloudflare TypeScript SDK 7.3.0, Wrangler 4.157.0, Terraform CLI 1.17.1, Pulumi CLI 3.274.0. These are version observations, not tested combinations; no apply, deploy, or Pulumi update was run.

References. - Cloudflare API: https://developers.cloudflare.com/api/ - Cloudflare API get started and tokens: https://developers.cloudflare.com/fundamentals/api/get-started/ - Create an API token: https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ - Account API tokens and compatibility: https://developers.cloudflare.com/fundamentals/api/get-started/account-owned-tokens/ - API token permissions: https://developers.cloudflare.com/fundamentals/api/reference/permissions/ - API rate limits: https://developers.cloudflare.com/fundamentals/api/reference/limits/ - API SDKs: https://developers.cloudflare.com/fundamentals/api/reference/sdks/ - Cloudflare Terraform: https://developers.cloudflare.com/terraform/ - Terraform get started: https://developers.cloudflare.com/terraform/installing/ - Terraform best practices: https://developers.cloudflare.com/terraform/advanced-topics/best-practices/ - Import Cloudflare resources: https://developers.cloudflare.com/terraform/advanced-topics/import-cloudflare-resources/ - Cloudflare Pulumi: https://developers.cloudflare.com/pulumi/ - Pulumi Worker tutorial: https://developers.cloudflare.com/pulumi/tutorial/hello-world/ - Workers infrastructure as code: https://developers.cloudflare.com/workers/platform/infrastructure-as-code/ - Wrangler configuration: https://developers.cloudflare.com/workers/wrangler/configuration/ - Terraform plan exit codes: https://developer.hashicorp.com/terraform/cli/commands/plan - Terraform import blocks: https://developer.hashicorp.com/terraform/language/import - Terraform state locking: https://developer.hashicorp.com/terraform/language/state/locking - Pulumi import: https://www.pulumi.com/docs/iac/cli/commands/pulumi_import/ - Pulumi preview: https://www.pulumi.com/docs/iac/cli/commands/pulumi_preview/

Next in the Series

In Build a Release Pipeline You Can Recover From, we'll explore Connect previews, approvals, migrations, feature flags, and rollback.