Worker Script
Deprecated
cloudflare.index/workerscript.WorkerScript has been deprecated in favor of cloudflare.index/workersscript.WorkersScript
Example Usage
resources:
exampleWorkersScript:
type: cloudflare:WorkersScript
name: example_workers_script
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
scriptName: this-is_my_script-01
metadata:
assets:
config:
_headers: |2
/dashboard/*
X-Frame-Options: DENY
/static/*
Access-Control-Allow-Origin: *
_redirects: |2
/foo /bar 301
/news/* /blog/:splat
htmlHandling: auto-trailing-slash
notFoundHandling: 404-page
runWorkerFirst: false
serveDirectly: true
jwt: jwt
bindings:
- name: MY_ENV_VAR
text: my_data
type: plain_text
bodyPart: worker.js
compatibilityDate: 2021-01-01
compatibilityFlags:
- nodejs_compat
keepAssets: false
keepBindings:
- string
logpush: false
mainModule: worker.js
migrations:
deletedClasses:
- string
newClasses:
- string
newSqliteClasses:
- string
newTag: v2
oldTag: v1
renamedClasses:
- from: from
to: to
transferredClasses:
- from: from
fromScript: from_script
to: to
observability:
enabled: true
headSamplingRate: 0.1
placement:
mode: smart
tags:
- string
tailConsumers:
- service: my-log-consumer
environment: production
namespace: my-namespace
usageModel: standard
Import
$ pulumi import cloudflare:index/workerScript:WorkerScript 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".