WorkersScriptArgs

data class WorkersScriptArgs(val accountId: Output<String>? = null, val assets: Output<WorkersScriptAssetsArgs>? = null, val bindings: Output<List<WorkersScriptBindingArgs>>? = null, val bodyPart: Output<String>? = null, val compatibilityDate: Output<String>? = null, val compatibilityFlags: Output<List<String>>? = null, val content: Output<String>? = null, val keepAssets: Output<Boolean>? = null, val keepBindings: Output<List<String>>? = null, val logpush: Output<Boolean>? = null, val mainModule: Output<String>? = null, val migrations: Output<WorkersScriptMigrationsArgs>? = null, val observability: Output<WorkersScriptObservabilityArgs>? = null, val placement: Output<WorkersScriptPlacementArgs>? = null, val scriptName: Output<String>? = null, val tailConsumers: Output<List<WorkersScriptTailConsumerArgs>>? = null, val usageModel: Output<String>? = null) : ConvertibleToJava<WorkersScriptArgs>

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/workersScript:WorkersScript example '<account_id>/<script_name>'

Constructors

Link copied to clipboard
constructor(accountId: Output<String>? = null, assets: Output<WorkersScriptAssetsArgs>? = null, bindings: Output<List<WorkersScriptBindingArgs>>? = null, bodyPart: Output<String>? = null, compatibilityDate: Output<String>? = null, compatibilityFlags: Output<List<String>>? = null, content: Output<String>? = null, keepAssets: Output<Boolean>? = null, keepBindings: Output<List<String>>? = null, logpush: Output<Boolean>? = null, mainModule: Output<String>? = null, migrations: Output<WorkersScriptMigrationsArgs>? = null, observability: Output<WorkersScriptObservabilityArgs>? = null, placement: Output<WorkersScriptPlacementArgs>? = null, scriptName: Output<String>? = null, tailConsumers: Output<List<WorkersScriptTailConsumerArgs>>? = null, usageModel: Output<String>? = null)

Properties

Link copied to clipboard
val accountId: Output<String>? = null

Identifier.

Link copied to clipboard
val assets: Output<WorkersScriptAssetsArgs>? = null

Configuration for assets within a Worker

Link copied to clipboard
val bindings: Output<List<WorkersScriptBindingArgs>>? = null

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.

Link copied to clipboard
val bodyPart: Output<String>? = null

Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the fetch event). Indicates a service worker syntax Worker.

Link copied to clipboard
val compatibilityDate: Output<String>? = null

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

Link copied to clipboard
val compatibilityFlags: Output<List<String>>? = null

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.

Link copied to clipboard
val content: Output<String>? = null

Module or Service Worker contents of the Worker.

Link copied to clipboard
val keepAssets: Output<Boolean>? = null

Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.

Link copied to clipboard
val keepBindings: Output<List<String>>? = null

List of binding types to keep from previous_upload.

Link copied to clipboard
val logpush: Output<Boolean>? = null

Whether Logpush is turned on for the Worker.

Link copied to clipboard
val mainModule: Output<String>? = null

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.

Link copied to clipboard

Migrations to apply for Durable Objects associated with this Worker.

Link copied to clipboard

Observability settings for the Worker.

Link copied to clipboard

Configuration for Smart Placement.

Link copied to clipboard
val scriptName: Output<String>? = null

Name of the script, used in URLs and route configuration.

Link copied to clipboard

List of Workers that will consume logs from the attached Worker.

Link copied to clipboard
val usageModel: Output<String>? = null

Usage model for the Worker invocations. Available values: "standard". //*/

Functions

Link copied to clipboard
open override fun toJava(): WorkersScriptArgs