Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Infrastructure as Code (IaC)

Guides for deploying and managing Cloudflare Workers programmatically using Terraform, Pulumi, and Cloudflare SDKs, including specific instructions for handling bindings and bundling workflows.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Infrastructure as Code (IaC)

Guides for deploying and managing Cloudflare Workers programmatically using Terraform, Pulumi, and Cloudflare SDKs, including specific instructions for handling bindings and bundling workflows.

When To Use

Use when automating Worker deployments through CI/CD pipelines, managing infrastructure via Terraform, or using SDKs to programmatically control Cloudflare resources.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-infrastructure-as-iac-workflow-guide.mdAn overview of managing Cloudflare Workers using Infrastructure as Code tools like Terraform and the Workers API.Questions about an overview of managing Cloudflare Workers using Infrastructure as Code tools like Terraform and the Workers API.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-wrangler-deploy-dry.textA command line instruction demonstrating how to use wrangler deploy with the dry-run and outdir flags to preview infrastructure changes.Exact payloads, commands, or snippets shown in A command line instruction demonstrating how to use wrangler deploy with the dry-run and outdir flags to preview infr...
examples/workers-infrastructure-as-iac-cloudflare-workers-terraform-iac.textA Terraform configuration file demonstrating how to provision Cloudflare Workers and worker versions using infrastructure as code.Exact payloads, commands, or snippets shown in A Terraform configuration file demonstrating how to provision Cloudflare Workers and worker versions using infrastruc...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat.textA configuration snippet demonstrating how to define resource bindings like KV namespaces within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating how to define resource bindings like KV namespaces within a Workers Infrastruct...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-hcl-bindings.textAn example of defining Cloudflare Workers resource bindings using HCL syntax.Exact payloads, commands, or snippets shown in An example of defining Cloudflare Workers resource bindings using HCL syntax.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-2.textA text configuration example demonstrating how to define resource bindings for Cloudflare Workers using Infrastructure as Code syntax.Exact payloads, commands, or snippets shown in A text configuration example demonstrating how to define resource bindings for Cloudflare Workers using Infrastructur...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-3.textA text configuration showing how to define resource bindings like Durable Object namespaces within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A text configuration showing how to define resource bindings like Durable Object namespaces within a Workers Infrastr...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-4.textA configuration snippet demonstrating how to define service bindings within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating how to define service bindings within a Workers Infrastructure as Code setup.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-5.textA text configuration example demonstrating how to define resource bindings like queues within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A text configuration example demonstrating how to define resource bindings like queues within a Workers Infrastructur...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-6.textA text configuration snippet demonstrating how to define resource bindings like Vectorize within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A text configuration snippet demonstrating how to define resource bindings like Vectorize within a Workers Infrastruc...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-7.textA text configuration example demonstrating how to define resource bindings within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A text configuration example demonstrating how to define resource bindings within a Workers Infrastructure as Code se...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-8.textA text configuration snippet demonstrating how to define resource bindings for Cloudflare Workers using Infrastructure as Code.Exact payloads, commands, or snippets shown in A text configuration snippet demonstrating how to define resource bindings for Cloudflare Workers using Infrastructur...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-9.textA configuration snippet defining service bindings and VPC service IDs for Workers Infrastructure as Code.Exact payloads, commands, or snippets shown in A configuration snippet defining service bindings and VPC service IDs for Workers Infrastructure as Code.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-10.textA text configuration snippet demonstrating how to define worker bindings such as analytics engine datasets using infrastructure as code syntax.Exact payloads, commands, or snippets shown in A text configuration snippet demonstrating how to define worker bindings such as analytics engine datasets using infr...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-bindings-configurat-11.textA configuration snippet demonstrating how to define variable bindings within a Workers Infrastructure as Code setup.Exact payloads, commands, or snippets shown in A configuration snippet demonstrating how to define variable bindings within a Workers Infrastructure as Code setup.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-hcl-bindings-config.textA HCL configuration snippet demonstrating how to define resource bindings for Cloudflare Workers using Infrastructure as Code.Exact payloads, commands, or snippets shown in A HCL configuration snippet demonstrating how to define resource bindings for Cloudflare Workers using Infrastructure...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-terraform-resource.textA Terraform configuration snippet demonstrating how to define a cloudflare_worker_version resource for managing Workers via infrastructure as code.Exact payloads, commands, or snippets shown in A Terraform configuration snippet demonstrating how to define a cloudflareworkerversion resource for managing Workers...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-create-deploy-scrip.textA shell script using npm and tsn to create and deploy a Cloudflare Worker via infrastructure as code.Exact payloads, commands, or snippets shown in A shell script using npm and tsn to create and deploy a Cloudflare Worker via infrastructure as code.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-create-deploy-scrip-2.textA shell script using npm and tsn to create and deploy a Cloudflare Worker via infrastructure as code.Exact payloads, commands, or snippets shown in A shell script using npm and tsn to create and deploy a Cloudflare Worker via infrastructure as code.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-shell-script-variab.textA shell script snippet defining environment variables such as account_id, api_token, and base64 encoded worker scripts for infrastructure management.Exact payloads, commands, or snippets shown in A shell script snippet defining environment variables such as accountid, apitoken, and base64 encoded worker scripts...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-shell-script.textA shell script demonstrating how to use environment variables and base64 encoded scripts to manage Cloudflare Workers via infrastructure as code principles.Exact payloads, commands, or snippets shown in A shell script demonstrating how to use environment variables and base64 encoded scripts to manage Cloudflare Workers...
examples/workers-infrastructure-as-iac-cloudflare-workers-api-curl-script-upload.textA curl command demonstrating how to upload a Worker script to the Cloudflare API using an account ID and API token.Exact payloads, commands, or snippets shown in A curl command demonstrating how to upload a Worker script to the Cloudflare API using an account ID and API token.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-dispatch-namespace-.textA curl command demonstrating how to create a Workers dispatch namespace using the Cloudflare API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a Workers dispatch namespace using the Cloudflare API.
examples/workers-infrastructure-as-iac-cloudflare-workers-api-script-upload-curl.textA curl command demonstrating how to upload a Worker script with metadata and bindings via the Cloudflare API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to upload a Worker script with metadata and bindings via the Cloudflare API.
examples/workers-infrastructure-as-iac-cloudflare-workers-terraform-resource-conf.textA Terraform configuration snippet defining a cloudflare_worker and its associated cloudflare_workerversion resources.Exact payloads, commands, or snippets shown in A Terraform configuration snippet defining a cloudflareworker and its associated cloudflareworkerversion resources.
examples/workers-infrastructure-as-iac-cloudflare-workers-terraform-import-comman.textA terraform import command used to bring an existing cloudflare worker version into infrastructure as code management.Exact payloads, commands, or snippets shown in A terraform import command used to bring an existing cloudflare worker version into infrastructure as code management.
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-terraform-worker-ve.textA Terraform configuration snippet demonstrating the use of the cloudflare_worker_version resource to deploy worker content.Exact payloads, commands, or snippets shown in A Terraform configuration snippet demonstrating the use of the cloudflareworkerversion resource to deploy worker cont...
examples/workers-infrastructure-as-iac-cloudflare-workers-iac-terraform-worker-ve-2.textA Terraform configuration snippet demonstrating how to deploy a Cloudflare Worker using the cloudflare_worker_version resource with base64 encoded content.Exact payloads, commands, or snippets shown in A Terraform configuration snippet demonstrating how to deploy a Cloudflare Worker using the cloudflareworkerversion r...

What This Skill Covers

  • While Wrangler makes it easy to upload and manage Workers, there are times when you need a more programmatic approach. This could involve using Infrastructur...
  • Main sections: Workers Bundling, Terraform, Bindings in Terraform, KV Namespace Binding, R2 Bucket Binding.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/platform/infrastructure-as-code