bindings
Creates, updates, deletes, gets or lists a bindings resource.
Overview
| Name | bindings |
| Type | Resource |
| Id | cloudflare.workers_for_platforms.bindings |
Fields
The following fields are returned by SELECT queries:
- list
Fetch script bindings (Workers for Platforms).
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier of the D1 database to bind to. (example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, x-stainless-deprecation-message: This property has been renamed to database_id.) |
name | string | A JavaScript variable name for the binding. (example: myBinding) |
app_id | string | ID of the Flagship app to bind to for feature flag evaluation. (example: app-12345678-1234-1234-1234-123456789012) |
certificate_id | string | Identifier of the certificate to bind to. (example: efwu2n6s-q69d-2kr9-184j-4913e8h391k6) |
database_id | string | Identifier of the D1 database to bind to. (example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) |
namespace_id | string | Namespace identifier tag. (x-stainless-terraform-configurability: computed_optional, example: 0f2ac74b498b48028cb68387c421e279) |
network_id | string | Identifier of the network to bind to. Only "cf1:network" is currently supported. Mutually exclusive with tunnel_id. (example: cf1:network) |
service_id | string | Identifier of the VPC service to bind to. (example: 8c8b1387108e49be85669169793e7bd2) |
store_id | string | ID of the store containing the secret. (example: 8c8b1387108e49be85669169793e7bd2) |
tunnel_id | string | UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id. (example: abcd1234-5678-90ef-ghij-klmnopqrstuv) |
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. (default: latest, example: 8969331f-7192-434c-9938-6aea24ed58bf) |
bucket_name | string | R2 bucket to bind to. (example: my-r2-bucket) |
class_name | string | The exported class name of the Durable Object. (example: MyDurableObject, x-stainless-terraform-configurability: computed_optional) |
index_name | string | Name of the Vectorize index to bind to. (example: my-index-name) |
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. (example: cloudflare-blog) |
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. (example: MY_OLD_BINDING) |
queue_name | string | Name of the Queue to bind to. (example: my-queue) |
script_name | string | The script where the Durable Object is defined, if it is external to this Worker. (example: my-other-worker, x-stainless-terraform-configurability: computed_optional) |
secret_name | string | Name of the secret in the store. (example: my_secret) |
workflow_name | string | Name of the Workflow to bind to. (example: my-workflow) |
algorithm | object | Algorithm-specific key parameters. Learn more. |
allowed_destination_addresses | array | List of allowed destination addresses. |
allowed_sender_addresses | array | List of allowed sender addresses. |
dataset | string | The name of the dataset to bind to. (example: some_dataset) |
destination_address | string (email) | Destination address for the email. (example: user@example.com) |
dispatch_namespace | string | The dispatch namespace the Durable Object script belongs to. (example: my-dispatch-namespace) |
entrypoint | string | Entrypoint to invoke on the target Worker. (example: MyHandler) |
environment | string | The environment of the script_name to bind to. (example: production) |
format | string | Data format of the key. Learn more. (raw, pkcs8, spki, jwk) (example: raw) |
json | object | JSON data to use. |
jurisdiction | string | The jurisdiction of the R2 bucket. (eu, fedramp, fedramp-high) (example: eu) |
key_base64 | string | Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki". |
key_jwk | object | Key data in JSON Web Key format. Required if format is "jwk". |
namespace | string | The namespace the instance belongs to. Defaults to "default" if omitted. Customers who don't use namespaces can simply omit this field. (example: production) |
outbound | object | Outbound worker. |
part | string | The name of the file containing the data content. Only accepted for service worker syntax Workers. (example: my-module.bin) |
pipeline | string | Name of the Pipeline to bind to. (example: my-pipeline) |
service | string | Name of Worker to bind to. (example: my-worker) |
simple | object | The rate limit configuration. |
text | string | The text value to use. (example: Hello, world!) |
type | string | The kind of resource that the binding provides. (ai) |
usages | array | Allowed operations with the key. Learn more. (x-stainless-collection-type: set) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id, dispatch_namespace, script_name | Fetch script bindings from a script uploaded to a Workers for Platforms namespace. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
dispatch_namespace | string | The Workers-for-Platforms dispatch namespace. |
script_name | string | The Worker script name. |
SELECT examples
- list
Fetch script bindings from a script uploaded to a Workers for Platforms namespace.
SELECT
id,
name,
app_id,
certificate_id,
database_id,
namespace_id,
network_id,
service_id,
store_id,
tunnel_id,
version_id,
bucket_name,
class_name,
index_name,
instance_name,
old_name,
queue_name,
script_name,
secret_name,
workflow_name,
algorithm,
allowed_destination_addresses,
allowed_sender_addresses,
dataset,
destination_address,
dispatch_namespace,
entrypoint,
environment,
format,
json,
jurisdiction,
key_base64,
key_jwk,
namespace,
outbound,
part,
pipeline,
service,
simple,
text,
type,
usages
FROM cloudflare.workers_for_platforms.bindings
WHERE account_id = '{{ account_id }}' -- required
AND dispatch_namespace = '{{ dispatch_namespace }}' -- required
AND script_name = '{{ script_name }}' -- required
;