Skip to content
Start here

Beta

BetaWorkers

resource cloudflare_worker

required Expand Collapse
account_id: String

Identifier.

name: String

Name of the Worker.

optional Expand Collapse
logpush?: Bool

Whether logpush is enabled for the Worker.

tags?: Set[String]

Tags associated with the Worker.

observability?: Attributes

Observability settings for the Worker.

enabled?: Bool

Whether observability is enabled for the Worker.

head_sampling_rate?: Float64

The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).

logs?: Attributes

Log settings for the Worker.

destinations?: List[String]

A list of destinations where logs will be exported to.

enabled?: Bool

Whether logs are enabled for the Worker.

head_sampling_rate?: Float64

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).

invocation_logs?: Bool

Whether invocation logs are enabled for the Worker.

persist?: Bool

Whether log persistence is enabled for the Worker.

traces?: Attributes

Trace settings for the Worker.

destinations?: List[String]

A list of destinations where traces will be exported to.

enabled?: Bool

Whether traces are enabled for the Worker.

head_sampling_rate?: Float64

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).

persist?: Bool

Whether trace persistence is enabled for the Worker.

subdomain?: Attributes

Subdomain settings for the Worker.

enabled?: Bool

Whether the *.workers.dev subdomain is enabled for the Worker.

previews_enabled?: Bool

Whether preview URLs are enabled for the Worker.

tail_consumers?: Set[Attributes]

Other Workers that should consume logs from the Worker.

name: String

Name of the consumer Worker.

computed Expand Collapse
id: String

Immutable ID of the Worker.

created_on: Time

When the Worker was created.

deployed_on: Time

When the Worker's most recent deployment was created. null if the Worker has never been deployed.

updated_on: Time

When the Worker was most recently updated.

references: Attributes

Other resources that reference the Worker and depend on it existing.

dispatch_namespace_outbounds: List[Attributes]

Other Workers that reference the Worker as an outbound for a dispatch namespace.

namespace_id: String

ID of the dispatch namespace.

namespace_name: String

Name of the dispatch namespace.

worker_id: String

ID of the Worker using the dispatch namespace.

worker_name: String

Name of the Worker using the dispatch namespace.

domains: List[Attributes]

Custom domains connected to the Worker.

id: String

ID of the custom domain.

certificate_id: String

ID of the TLS certificate issued for the custom domain.

hostname: String

Full hostname of the custom domain, including the zone name.

zone_id: String

ID of the zone.

zone_name: String

Name of the zone.

durable_objects: List[Attributes]

Other Workers that reference Durable Object classes implemented by the Worker.

namespace_id: String

ID of the Durable Object namespace being used.

namespace_name: String

Name of the Durable Object namespace being used.

worker_id: String

ID of the Worker using the Durable Object implementation.

worker_name: String

Name of the Worker using the Durable Object implementation.

queues: List[Attributes]

Queues that send messages to the Worker.

queue_consumer_id: String

ID of the queue consumer configuration.

queue_id: String

ID of the queue.

queue_name: String

Name of the queue.

workers: List[Attributes]

Other Workers that reference the Worker using service bindings.

id: String

ID of the referencing Worker.

name: String

Name of the referencing Worker.

cloudflare_worker

resource "cloudflare_worker" "example_worker" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "my-worker"
  logpush = true
  observability = {
    enabled = true
    head_sampling_rate = 1
    logs = {
      destinations = ["string"]
      enabled = true
      head_sampling_rate = 1
      invocation_logs = true
      persist = true
    }
    traces = {
      destinations = ["string"]
      enabled = true
      head_sampling_rate = 1
      persist = true
    }
  }
  subdomain = {
    enabled = true
    previews_enabled = true
  }
  tags = ["my-team", "my-public-api"]
  tail_consumers = [{
    name = "my-tail-consumer"
  }]
}

data cloudflare_worker

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
worker_id?: String

Identifier for the Worker, which can be ID or name.

filter?: Attributes
order?: String

Sort direction.

order_by?: String

Property to sort results by.

computed Expand Collapse
id: String

Identifier for the Worker, which can be ID or name.

created_on: Time

When the Worker was created.

deployed_on: Time

When the Worker's most recent deployment was created. null if the Worker has never been deployed.

logpush: Bool

Whether logpush is enabled for the Worker.

name: String

Name of the Worker.

updated_on: Time

When the Worker was most recently updated.

tags: Set[String]

Tags associated with the Worker.

observability: Attributes

Observability settings for the Worker.

enabled: Bool

Whether observability is enabled for the Worker.

head_sampling_rate: Float64

The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).

logs: Attributes

Log settings for the Worker.

destinations: List[String]

A list of destinations where logs will be exported to.

enabled: Bool

Whether logs are enabled for the Worker.

head_sampling_rate: Float64

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).

invocation_logs: Bool

Whether invocation logs are enabled for the Worker.

persist: Bool

Whether log persistence is enabled for the Worker.

traces: Attributes

Trace settings for the Worker.

destinations: List[String]

A list of destinations where traces will be exported to.

enabled: Bool

Whether traces are enabled for the Worker.

head_sampling_rate: Float64

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).

persist: Bool

Whether trace persistence is enabled for the Worker.

references: Attributes

Other resources that reference the Worker and depend on it existing.

dispatch_namespace_outbounds: List[Attributes]

Other Workers that reference the Worker as an outbound for a dispatch namespace.

namespace_id: String

ID of the dispatch namespace.

namespace_name: String

Name of the dispatch namespace.

worker_id: String

ID of the Worker using the dispatch namespace.

worker_name: String

Name of the Worker using the dispatch namespace.

domains: List[Attributes]

Custom domains connected to the Worker.

id: String

ID of the custom domain.

certificate_id: String

ID of the TLS certificate issued for the custom domain.

hostname: String

Full hostname of the custom domain, including the zone name.

zone_id: String

ID of the zone.

zone_name: String

Name of the zone.

durable_objects: List[Attributes]

Other Workers that reference Durable Object classes implemented by the Worker.

namespace_id: String

ID of the Durable Object namespace being used.

namespace_name: String

Name of the Durable Object namespace being used.

worker_id: String

ID of the Worker using the Durable Object implementation.

worker_name: String

Name of the Worker using the Durable Object implementation.

queues: List[Attributes]

Queues that send messages to the Worker.

queue_consumer_id: String

ID of the queue consumer configuration.

queue_id: String

ID of the queue.

queue_name: String

Name of the queue.

workers: List[Attributes]

Other Workers that reference the Worker using service bindings.

id: String

ID of the referencing Worker.

name: String

Name of the referencing Worker.

subdomain: Attributes

Subdomain settings for the Worker.

enabled: Bool

Whether the *.workers.dev subdomain is enabled for the Worker.

previews_enabled: Bool

Whether preview URLs are enabled for the Worker.

tail_consumers: Set[Attributes]

Other Workers that should consume logs from the Worker.

name: String

Name of the consumer Worker.

cloudflare_worker

data "cloudflare_worker" "example_worker" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  worker_id = "worker_id"
}

data cloudflare_workers

required Expand Collapse
account_id: String

Identifier.

optional Expand Collapse
order?: String

Sort direction.

order_by?: String

Property to sort results by.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Immutable ID of the Worker.

created_on: Time

When the Worker was created.

logpush: Bool

Whether logpush is enabled for the Worker.

name: String

Name of the Worker.

observability: Attributes

Observability settings for the Worker.

enabled: Bool

Whether observability is enabled for the Worker.

head_sampling_rate: Float64

The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).

logs: Attributes

Log settings for the Worker.

destinations: List[String]

A list of destinations where logs will be exported to.

enabled: Bool

Whether logs are enabled for the Worker.

head_sampling_rate: Float64

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).

invocation_logs: Bool

Whether invocation logs are enabled for the Worker.

persist: Bool

Whether log persistence is enabled for the Worker.

traces: Attributes

Trace settings for the Worker.

destinations: List[String]

A list of destinations where traces will be exported to.

enabled: Bool

Whether traces are enabled for the Worker.

head_sampling_rate: Float64

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).

persist: Bool

Whether trace persistence is enabled for the Worker.

references: Attributes

Other resources that reference the Worker and depend on it existing.

dispatch_namespace_outbounds: List[Attributes]

Other Workers that reference the Worker as an outbound for a dispatch namespace.

namespace_id: String

ID of the dispatch namespace.

namespace_name: String

Name of the dispatch namespace.

worker_id: String

ID of the Worker using the dispatch namespace.

worker_name: String

Name of the Worker using the dispatch namespace.

domains: List[Attributes]

Custom domains connected to the Worker.

id: String

ID of the custom domain.

certificate_id: String

ID of the TLS certificate issued for the custom domain.

hostname: String

Full hostname of the custom domain, including the zone name.

zone_id: String

ID of the zone.

zone_name: String

Name of the zone.

durable_objects: List[Attributes]

Other Workers that reference Durable Object classes implemented by the Worker.

namespace_id: String

ID of the Durable Object namespace being used.

namespace_name: String

Name of the Durable Object namespace being used.

worker_id: String

ID of the Worker using the Durable Object implementation.

worker_name: String

Name of the Worker using the Durable Object implementation.

queues: List[Attributes]

Queues that send messages to the Worker.

queue_consumer_id: String

ID of the queue consumer configuration.

queue_id: String

ID of the queue.

queue_name: String

Name of the queue.

workers: List[Attributes]

Other Workers that reference the Worker using service bindings.

id: String

ID of the referencing Worker.

name: String

Name of the referencing Worker.

subdomain: Attributes

Subdomain settings for the Worker.

enabled: Bool

Whether the *.workers.dev subdomain is enabled for the Worker.

previews_enabled: Bool

Whether preview URLs are enabled for the Worker.

tags: Set[String]

Tags associated with the Worker.

tail_consumers: Set[Attributes]

Other Workers that should consume logs from the Worker.

name: String

Name of the consumer Worker.

updated_on: Time

When the Worker was most recently updated.

deployed_on: Time

When the Worker's most recent deployment was created. null if the Worker has never been deployed.

cloudflare_workers

data "cloudflare_workers" "example_workers" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

BetaWorkersVersions

resource cloudflare_worker_version

required Expand Collapse
account_id: String

Identifier.

worker_id: String

Identifier for the Worker, which can be ID or name.

optional Expand Collapse
compatibility_date?: String

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

main_module?: String

The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler).

migrations?: Attributes

Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed.

deleted_classes?: List[String]

A list of classes to delete Durable Object namespaces from.

new_classes?: List[String]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes?: List[String]

A list of classes to create Durable Object namespaces with SQLite from.

new_tag?: String

Tag to set as the latest migration tag.

old_tag?: String

Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.

renamed_classes?: List[Attributes]

A list of classes with Durable Object namespaces that were renamed.

from?: String
to?: String
transferred_classes?: List[Attributes]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from?: String
from_script?: String
to?: String
steps?: List[Attributes]

Migrations to apply in order.

deleted_classes?: List[String]

A list of classes to delete Durable Object namespaces from.

new_classes?: List[String]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes?: List[String]

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes?: List[Attributes]

A list of classes with Durable Object namespaces that were renamed.

from?: String
to?: String
transferred_classes?: List[Attributes]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from?: String
from_script?: String
to?: String
modules?: Set[Attributes]

Code, sourcemaps, and other content used at runtime.

This includes _headers and _redirects files used to configure Static Assets. _headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

content_base64: String

The base64-encoded module content.

content_type: String

The content type of the module.

name: String

The name of the module.

placement?: Attributes

Configuration for Smart Placement. Specify mode='smart' for Smart Placement, or one of region/hostname/host.

mode?: String

Enables Smart Placement.

region?: String

Cloud region for targeted placement in format 'provider:region'.

hostname?: String

HTTP hostname for targeted placement.

host?: String

TCP host and port for targeted placement.

target?: List[Attributes]

Array of placement targets (currently limited to single target).

region?: String

Cloud region in format 'provider:region'.

hostname?: String

HTTP hostname for targeted placement.

host?: String

TCP host:port for targeted placement.

Deprecatedusage_model?: String

Usage model for the version.

compatibility_flags?: Set[String]

Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.

annotations?: Attributes

Metadata about the version.

workers_message?: String

Human-readable message about the version.

workers_tag?: String

User-provided identifier for the version.

workers_triggered_by: String

Operation that triggered the creation of the version.

assets?: Attributes

Configuration for assets within a Worker.

_headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

config?: Attributes

Configuration for assets within a Worker.

html_handling?: String

Determines the redirects and rewrites of requests for HTML content.

not_found_handling?: String

Determines the response when a request does not match a static asset, and there is no Worker script.

run_worker_first?: List[String]

Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either '/' or '!/'. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.

jwt?: String

Token provided upon successful upload of all files from a registered manifest.

bindings?: List[Attributes]

List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.

name: String

A JavaScript variable name for the binding.

type: String

The kind of resource that the binding provides.

instance_name?: String

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

namespace?: String

The namespace the instance belongs to. Defaults to "default" if omitted. Customers who don't use namespaces can simply omit this field.

dataset?: String

The name of the dataset to bind to.

id?: String

Identifier of the D1 database to bind to.

part?: String

The name of the file containing the data content. Only accepted for service worker syntax Workers.

outbound?: Attributes

Outbound worker.

params?: List[Attributes]

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: String

Name of the parameter.

worker?: Attributes

Outbound worker.

entrypoint?: String

Entrypoint to invoke on the outbound worker.

environment?: String

Environment of the outbound worker.

service?: String

Name of the outbound worker.

class_name?: String

The exported class name of the Durable Object.

dispatch_namespace?: String

The dispatch namespace the Durable Object script belongs to.

environment?: String

The environment of the script_name to bind to.

namespace_id?: String

Namespace identifier tag.

script_name?: String

The script where the Durable Object is defined, if it is external to this Worker.

old_name?: String

The old name of the inherited binding. If set, the binding will be renamed from old_name to name in the new version. If not set, the binding will keep the same name between versions.

version_id?: String

Identifier for the version to inherit the binding from, which can be the version ID or the literal "latest" to inherit from the latest version. Defaults to inheriting the binding from the latest version.

json?: JSON

JSON data to use.

certificate_id?: String

Identifier of the certificate to bind to.

text?: String

The text value to use.

pipeline?: String

Name of the Pipeline to bind to.

queue_name?: String

Name of the Queue to bind to.

simple?: Attributes

The rate limit configuration.

limit: Float64

The limit (requests per period).

period: Int64

The period in seconds.

bucket_name?: String

R2 bucket to bind to.

jurisdiction?: String

The jurisdiction of the R2 bucket.

allowed_destination_addresses?: List[String]

List of allowed destination addresses.

allowed_sender_addresses?: List[String]

List of allowed sender addresses.

destination_address?: String

Destination address for the email.

service?: String

Name of Worker to bind to.

entrypoint?: String

Entrypoint to invoke on the target Worker.

index_name?: String

Name of the Vectorize index to bind to.

secret_name?: String

Name of the secret in the store.

store_id?: String

ID of the store containing the secret.

algorithm?: JSON

Algorithm-specific key parameters. Learn more.

format?: String

Data format of the key. Learn more.

usages?: Set[String]

Allowed operations with the key. Learn more.

key_base64?: String

Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki".

key_jwk?: JSON

Key data in JSON Web Key format. Required if format is "jwk".

workflow_name?: String

Name of the Workflow to bind to.

service_id?: String

Identifier of the VPC service to bind to.

network_id?: String

Identifier of the network to bind to. Only "cf1:network" is currently supported. Mutually exclusive with tunnel_id.

tunnel_id?: String

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

limits?: Attributes

Resource limits enforced at runtime.

cpu_ms: Int64

CPU time limit in milliseconds.

computed Expand Collapse
id: String

Version identifier.

created_on: Time

When the version was created.

number: Int64

The integer version number, starting from one.

source: String

The client used to create the version.

startup_time_ms: Int64

Time in milliseconds spent on Worker startup.

urls: List[String]

All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.

cloudflare_worker_version

resource "cloudflare_worker_version" "example_worker_version" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  worker_id = "worker_id"
  annotations = {
    workers_message = "Fixed bug."
    workers_tag = "v1.0.1"
  }
  assets = {
    config = {
      html_handling = "auto-trailing-slash"
      not_found_handling = "404-page"
      run_worker_first = ["string"]
    }
    jwt = "jwt"
  }
  bindings = [{
    name = "MY_ENV_VAR"
    text = "my_data"
    type = "plain_text"
  }]
  compatibility_date = "2021-01-01"
  compatibility_flags = ["nodejs_compat"]
  limits = {
    cpu_ms = 50
  }
  main_module = "index.js"
  migrations = {
    deleted_classes = ["string"]
    new_classes = ["string"]
    new_sqlite_classes = ["string"]
    new_tag = "v2"
    old_tag = "v1"
    renamed_classes = [{
      from = "from"
      to = "to"
    }]
    transferred_classes = [{
      from = "from"
      from_script = "from_script"
      to = "to"
    }]
  }
  modules = [{
    content_base64 = "ZXhwb3J0IGRlZmF1bHQgewogIGFzeW5jIGZldGNoKHJlcXVlc3QsIGVudiwgY3R4KSB7CiAgICByZXR1cm4gbmV3IFJlc3BvbnNlKCdIZWxsbyBXb3JsZCEnKQogIH0KfQ=="
    content_type = "application/javascript+module"
    name = "index.js"
  }]
  placement = {
    mode = "smart"
  }
  usage_model = "standard"
}

data cloudflare_worker_version

required Expand Collapse
version_id: String

Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.

account_id: String

Identifier.

worker_id: String

Identifier for the Worker, which can be ID or name.

optional Expand Collapse
include?: String

Whether to include the modules property of the version in the response, which contains code and sourcemap content and may add several megabytes to the response size.

computed Expand Collapse
id: String

Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.

compatibility_date: String

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

created_on: Time

When the version was created.

main_module: String

The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler).

number: Int64

The integer version number, starting from one.

source: String

The client used to create the version.

startup_time_ms: Int64

Time in milliseconds spent on Worker startup.

Deprecatedusage_model: String

Usage model for the version.

compatibility_flags: Set[String]

Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.

urls: List[String]

All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.

annotations: Attributes

Metadata about the version.

workers_message: String

Human-readable message about the version.

workers_tag: String

User-provided identifier for the version.

workers_triggered_by: String

Operation that triggered the creation of the version.

assets: Attributes

Configuration for assets within a Worker.

_headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

config: Attributes

Configuration for assets within a Worker.

html_handling: String

Determines the redirects and rewrites of requests for HTML content.

not_found_handling: String

Determines the response when a request does not match a static asset, and there is no Worker script.

run_worker_first: List[String]

Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either '/' or '!/'. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.

jwt: String

Token provided upon successful upload of all files from a registered manifest.

bindings: List[Attributes]

List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.

name: String

A JavaScript variable name for the binding.

type: String

The kind of resource that the binding provides.

instance_name: String

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

namespace: String

The namespace the instance belongs to. Defaults to "default" if omitted. Customers who don't use namespaces can simply omit this field.

dataset: String

The name of the dataset to bind to.

id: String

Identifier of the D1 database to bind to.

part: String

The name of the file containing the data content. Only accepted for service worker syntax Workers.

outbound: Attributes

Outbound worker.

params: List[Attributes]

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: String

Name of the parameter.

worker: Attributes

Outbound worker.

entrypoint: String

Entrypoint to invoke on the outbound worker.

environment: String

Environment of the outbound worker.

service: String

Name of the outbound worker.

class_name: String

The exported class name of the Durable Object.

dispatch_namespace: String

The dispatch namespace the Durable Object script belongs to.

environment: String

The environment of the script_name to bind to.

namespace_id: String

Namespace identifier tag.

script_name: String

The script where the Durable Object is defined, if it is external to this Worker.

old_name: String

The old name of the inherited binding. If set, the binding will be renamed from old_name to name in the new version. If not set, the binding will keep the same name between versions.

version_id: String

Identifier for the version to inherit the binding from, which can be the version ID or the literal "latest" to inherit from the latest version. Defaults to inheriting the binding from the latest version.

json: JSON

JSON data to use.

certificate_id: String

Identifier of the certificate to bind to.

text: String

The text value to use.

pipeline: String

Name of the Pipeline to bind to.

queue_name: String

Name of the Queue to bind to.

simple: Attributes

The rate limit configuration.

limit: Float64

The limit (requests per period).

period: Int64

The period in seconds.

bucket_name: String

R2 bucket to bind to.

jurisdiction: String

The jurisdiction of the R2 bucket.

allowed_destination_addresses: List[String]

List of allowed destination addresses.

allowed_sender_addresses: List[String]

List of allowed sender addresses.

destination_address: String

Destination address for the email.

service: String

Name of Worker to bind to.

entrypoint: String

Entrypoint to invoke on the target Worker.

index_name: String

Name of the Vectorize index to bind to.

secret_name: String

Name of the secret in the store.

store_id: String

ID of the store containing the secret.

algorithm: JSON

Algorithm-specific key parameters. Learn more.

format: String

Data format of the key. Learn more.

usages: Set[String]

Allowed operations with the key. Learn more.

key_base64: String

Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki".

key_jwk: JSON

Key data in JSON Web Key format. Required if format is "jwk".

workflow_name: String

Name of the Workflow to bind to.

service_id: String

Identifier of the VPC service to bind to.

network_id: String

Identifier of the network to bind to. Only "cf1:network" is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: String

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

limits: Attributes

Resource limits enforced at runtime.

cpu_ms: Int64

CPU time limit in milliseconds.

migrations: Attributes

Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed.

deleted_classes: List[String]

A list of classes to delete Durable Object namespaces from.

new_classes: List[String]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: List[String]

A list of classes to create Durable Object namespaces with SQLite from.

new_tag: String

Tag to set as the latest migration tag.

old_tag: String

Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.

renamed_classes: List[Attributes]

A list of classes with Durable Object namespaces that were renamed.

from: String
to: String
transferred_classes: List[Attributes]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: String
from_script: String
to: String
steps: List[Attributes]

Migrations to apply in order.

deleted_classes: List[String]

A list of classes to delete Durable Object namespaces from.

new_classes: List[String]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: List[String]

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes: List[Attributes]

A list of classes with Durable Object namespaces that were renamed.

from: String
to: String
transferred_classes: List[Attributes]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: String
from_script: String
to: String
modules: Set[Attributes]

Code, sourcemaps, and other content used at runtime.

This includes _headers and _redirects files used to configure Static Assets. _headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

content_base64: String

The base64-encoded module content.

content_type: String

The content type of the module.

name: String

The name of the module.

placement: Attributes

Configuration for Smart Placement. Specify mode='smart' for Smart Placement, or one of region/hostname/host.

mode: String

Enables Smart Placement.

region: String

Cloud region for targeted placement in format 'provider:region'.

hostname: String

HTTP hostname for targeted placement.

host: String

TCP host and port for targeted placement.

target: List[Attributes]

Array of placement targets (currently limited to single target).

region: String

Cloud region in format 'provider:region'.

hostname: String

HTTP hostname for targeted placement.

host: String

TCP host:port for targeted placement.

cloudflare_worker_version

data "cloudflare_worker_version" "example_worker_version" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  worker_id = "worker_id"
  version_id = "version_id"
  include = "modules"
}

data cloudflare_worker_versions

required Expand Collapse
account_id: String

Identifier.

worker_id: String

Identifier for the Worker, which can be ID or name.

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Version identifier.

created_on: Time

When the version was created.

number: Int64

The integer version number, starting from one.

urls: List[String]

All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.

annotations: Attributes

Metadata about the version.

workers_message: String

Human-readable message about the version.

workers_tag: String

User-provided identifier for the version.

workers_triggered_by: String

Operation that triggered the creation of the version.

assets: Attributes

Configuration for assets within a Worker.

_headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

config: Attributes

Configuration for assets within a Worker.

html_handling: String

Determines the redirects and rewrites of requests for HTML content.

not_found_handling: String

Determines the response when a request does not match a static asset, and there is no Worker script.

run_worker_first: List[String]

Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either '/' or '!/'. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.

jwt: String

Token provided upon successful upload of all files from a registered manifest.

bindings: List[Attributes]

List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.

name: String

A JavaScript variable name for the binding.

type: String

The kind of resource that the binding provides.

instance_name: String

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

namespace: String

The namespace the instance belongs to. Defaults to "default" if omitted. Customers who don't use namespaces can simply omit this field.

dataset: String

The name of the dataset to bind to.

id: String

Identifier of the D1 database to bind to.

part: String

The name of the file containing the data content. Only accepted for service worker syntax Workers.

outbound: Attributes

Outbound worker.

params: List[Attributes]

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: String

Name of the parameter.

worker: Attributes

Outbound worker.

entrypoint: String

Entrypoint to invoke on the outbound worker.

environment: String

Environment of the outbound worker.

service: String

Name of the outbound worker.

class_name: String

The exported class name of the Durable Object.

dispatch_namespace: String

The dispatch namespace the Durable Object script belongs to.

environment: String

The environment of the script_name to bind to.

namespace_id: String

Namespace identifier tag.

script_name: String

The script where the Durable Object is defined, if it is external to this Worker.

old_name: String

The old name of the inherited binding. If set, the binding will be renamed from old_name to name in the new version. If not set, the binding will keep the same name between versions.

version_id: String

Identifier for the version to inherit the binding from, which can be the version ID or the literal "latest" to inherit from the latest version. Defaults to inheriting the binding from the latest version.

json: JSON

JSON data to use.

certificate_id: String

Identifier of the certificate to bind to.

text: String

The text value to use.

pipeline: String

Name of the Pipeline to bind to.

queue_name: String

Name of the Queue to bind to.

simple: Attributes

The rate limit configuration.

limit: Float64

The limit (requests per period).

period: Int64

The period in seconds.

bucket_name: String

R2 bucket to bind to.

jurisdiction: String

The jurisdiction of the R2 bucket.

allowed_destination_addresses: List[String]

List of allowed destination addresses.

allowed_sender_addresses: List[String]

List of allowed sender addresses.

destination_address: String

Destination address for the email.

service: String

Name of Worker to bind to.

entrypoint: String

Entrypoint to invoke on the target Worker.

index_name: String

Name of the Vectorize index to bind to.

secret_name: String

Name of the secret in the store.

store_id: String

ID of the store containing the secret.

algorithm: JSON

Algorithm-specific key parameters. Learn more.

format: String

Data format of the key. Learn more.

usages: Set[String]

Allowed operations with the key. Learn more.

key_base64: String

Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki".

key_jwk: JSON

Key data in JSON Web Key format. Required if format is "jwk".

workflow_name: String

Name of the Workflow to bind to.

service_id: String

Identifier of the VPC service to bind to.

network_id: String

Identifier of the network to bind to. Only "cf1:network" is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: String

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

compatibility_date: String

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: Set[String]

Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.

limits: Attributes

Resource limits enforced at runtime.

cpu_ms: Int64

CPU time limit in milliseconds.

main_module: String

The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler).

migrations: Attributes

Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed.

deleted_classes: List[String]

A list of classes to delete Durable Object namespaces from.

new_classes: List[String]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: List[String]

A list of classes to create Durable Object namespaces with SQLite from.

new_tag: String

Tag to set as the latest migration tag.

old_tag: String

Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.

renamed_classes: List[Attributes]

A list of classes with Durable Object namespaces that were renamed.

from: String
to: String
transferred_classes: List[Attributes]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: String
from_script: String
to: String
steps: List[Attributes]

Migrations to apply in order.

deleted_classes: List[String]

A list of classes to delete Durable Object namespaces from.

new_classes: List[String]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: List[String]

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes: List[Attributes]

A list of classes with Durable Object namespaces that were renamed.

from: String
to: String
transferred_classes: List[Attributes]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from: String
from_script: String
to: String
modules: Set[Attributes]

Code, sourcemaps, and other content used at runtime.

This includes _headers and _redirects files used to configure Static Assets. _headers and _redirects files should be included as modules named _headers and _redirects with content type text/plain.

content_base64: String

The base64-encoded module content.

content_type: String

The content type of the module.

name: String

The name of the module.

placement: Attributes

Configuration for Smart Placement. Specify mode='smart' for Smart Placement, or one of region/hostname/host.

mode: String

Enables Smart Placement.

region: String

Cloud region for targeted placement in format 'provider:region'.

hostname: String

HTTP hostname for targeted placement.

host: String

TCP host and port for targeted placement.

target: List[Attributes]

Array of placement targets (currently limited to single target).

region: String

Cloud region in format 'provider:region'.

hostname: String

HTTP hostname for targeted placement.

host: String

TCP host:port for targeted placement.

source: String

The client used to create the version.

startup_time_ms: Int64

Time in milliseconds spent on Worker startup.

Deprecatedusage_model: String

Usage model for the version.

cloudflare_worker_versions

data "cloudflare_worker_versions" "example_worker_versions" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  worker_id = "worker_id"
}