Skip to main content

script_and_version_settings

Creates, updates, deletes, gets or lists a script_and_version_settings resource.

Overview

Namescript_and_version_settings
TypeResource
Idcloudflare.workers.script_and_version_settings

Fields

The following fields are returned by SELECT queries:

Fetch settings.

NameDatatypeDescription
annotationsobjectAnnotations for the Worker version. Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations.
bindingsarrayList 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.
compatibility_datestringDate indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker. (example: 2021-01-01, default: )
compatibility_flagsarrayFlags 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. (x-stainless-collection-type: set)
limitsobjectLimits to apply for this Worker.
logpushbooleanWhether Logpush is turned on for the Worker.
migrationsobjectMigrations to apply for Durable Objects associated with this Worker.
observabilityobjectObservability settings for the Worker.
placementobjectConfiguration for Smart Placement. Specify mode='smart' for Smart Placement, or one of region/hostname/host.
tagsarrayTags associated with the Worker. (x-stainless-collection-type: set)
tail_consumersarrayList of Workers that will consume logs from the attached Worker. (x-stainless-collection-type: set)
usage_modelstringUsage model for the Worker invocations. (standard, bundled, unbound) (default: standard, example: standard)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, script_nameGet metadata and config, such as bindings or usage model.
editupdateaccount_id, script_namePatch metadata or config, such as bindings or usage model.

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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
script_namestringThe Worker script name.

SELECT examples

Get metadata and config, such as bindings or usage model.

SELECT
annotations,
bindings,
compatibility_date,
compatibility_flags,
limits,
logpush,
migrations,
observability,
placement,
tags,
tail_consumers,
usage_model
FROM cloudflare.workers.script_and_version_settings
WHERE account_id = '{{ account_id }}' -- required
AND script_name = '{{ script_name }}' -- required
;

UPDATE examples

Patch metadata or config, such as bindings or usage model.

UPDATE cloudflare.workers.script_and_version_settings
SET
settings = '{{ settings }}'
WHERE
account_id = '{{ account_id }}' --required
AND script_name = '{{ script_name }}' --required
RETURNING
errors,
messages,
result,
success;