Workers Script
Example Usage
resources:
exampleWorkersScript:
type: cloudflare:WorkersScript
name: example_workers_script
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
scriptName: this-is_my_script-01
assets:
config:
htmlHandling: auto-trailing-slash
notFoundHandling: none
runWorkerFirst: false
serveDirectly: true
jwt: jwt
bindings:
- name: MY_ENV_VAR
type: plain_text
bodyPart: worker.js
compatibilityDate: 2021-01-01
compatibilityFlags:
- nodejs_compat
content:
fn::invoke:
function: std:file
arguments:
input: worker.js
return: result
keepAssets: false
keepBindings:
- string
logpush: false
mainModule: worker.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
fromScript: from_script
to: to
observability:
enabled: true
head_sampling_rate: 0.1
placement:
mode: smart
tags:
- string
tailConsumers:
- service: my-log-consumer
environment: production
namespace: my-namespace
usageModel: standard
Import
$ pulumi import cloudflare:index/workersScript:WorkersScript example '<account_id>/<script_name>'
Properties
Configuration for assets within a Worker
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.
Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
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
.
Whether a Worker contains modules.
Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
List of binding types to keep from previous_upload.
Name of the part in the multipart request that contains the main module (e.g. the file exporting a fetch
handler). Indicates a module syntax
Worker.
Migrations to apply for Durable Objects associated with this Worker.
When the script was last modified.
Observability settings for the Worker.
Configuration for Smart Placement.
Name of the script, used in URLs and route configuration.
List of Workers that will consume logs from the attached Worker.
Usage model for the Worker invocations. Available values: "standard".