cloudflare.WorkersScript
Explore with Pulumi AI
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
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
Create WorkersScript Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkersScript(name: string, args: WorkersScriptArgs, opts?: CustomResourceOptions);
@overload
def WorkersScript(resource_name: str,
args: WorkersScriptArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WorkersScript(resource_name: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
script_name: Optional[str] = None,
account_id: Optional[str] = None,
keep_bindings: Optional[Sequence[str]] = None,
main_module: Optional[str] = None,
compatibility_flags: Optional[Sequence[str]] = None,
body_part: Optional[str] = None,
keep_assets: Optional[bool] = None,
bindings: Optional[Sequence[WorkersScriptBindingArgs]] = None,
logpush: Optional[bool] = None,
compatibility_date: Optional[str] = None,
migrations: Optional[WorkersScriptMigrationsArgs] = None,
observability: Optional[WorkersScriptObservabilityArgs] = None,
placement: Optional[WorkersScriptPlacementArgs] = None,
assets: Optional[WorkersScriptAssetsArgs] = None,
tail_consumers: Optional[Sequence[WorkersScriptTailConsumerArgs]] = None,
usage_model: Optional[str] = None)
func NewWorkersScript(ctx *Context, name string, args WorkersScriptArgs, opts ...ResourceOption) (*WorkersScript, error)
public WorkersScript(string name, WorkersScriptArgs args, CustomResourceOptions? opts = null)
public WorkersScript(String name, WorkersScriptArgs args)
public WorkersScript(String name, WorkersScriptArgs args, CustomResourceOptions options)
type: cloudflare:WorkersScript
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WorkersScriptArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WorkersScriptArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WorkersScriptArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkersScriptArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkersScriptArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var workersScriptResource = new Cloudflare.WorkersScript("workersScriptResource", new()
{
Content = "string",
ScriptName = "string",
AccountId = "string",
KeepBindings = new[]
{
"string",
},
MainModule = "string",
CompatibilityFlags = new[]
{
"string",
},
BodyPart = "string",
KeepAssets = false,
Bindings = new[]
{
new Cloudflare.Inputs.WorkersScriptBindingArgs
{
Name = "string",
Type = "string",
Environment = "string",
Namespace = "string",
BucketName = "string",
Id = "string",
IndexName = "string",
Json = "string",
ClassName = "string",
Dataset = "string",
NamespaceId = "string",
Outbound = new Cloudflare.Inputs.WorkersScriptBindingOutboundArgs
{
Params = new[]
{
"string",
},
Worker = new Cloudflare.Inputs.WorkersScriptBindingOutboundWorkerArgs
{
Environment = "string",
Service = "string",
},
},
QueueName = "string",
ScriptName = "string",
Service = "string",
Text = "string",
CertificateId = "string",
},
},
Logpush = false,
CompatibilityDate = "string",
Migrations = new Cloudflare.Inputs.WorkersScriptMigrationsArgs
{
DeletedClasses = new[]
{
"string",
},
NewClasses = new[]
{
"string",
},
NewSqliteClasses = new[]
{
"string",
},
NewTag = "string",
OldTag = "string",
RenamedClasses = new[]
{
new Cloudflare.Inputs.WorkersScriptMigrationsRenamedClassArgs
{
From = "string",
To = "string",
},
},
Steps = new[]
{
new Cloudflare.Inputs.WorkersScriptMigrationsStepArgs
{
DeletedClasses = new[]
{
"string",
},
NewClasses = new[]
{
"string",
},
NewSqliteClasses = new[]
{
"string",
},
RenamedClasses = new[]
{
new Cloudflare.Inputs.WorkersScriptMigrationsStepRenamedClassArgs
{
From = "string",
To = "string",
},
},
TransferredClasses = new[]
{
new Cloudflare.Inputs.WorkersScriptMigrationsStepTransferredClassArgs
{
From = "string",
FromScript = "string",
To = "string",
},
},
},
},
TransferredClasses = new[]
{
new Cloudflare.Inputs.WorkersScriptMigrationsTransferredClassArgs
{
From = "string",
FromScript = "string",
To = "string",
},
},
},
Observability = new Cloudflare.Inputs.WorkersScriptObservabilityArgs
{
Enabled = false,
HeadSamplingRate = 0,
},
Placement = new Cloudflare.Inputs.WorkersScriptPlacementArgs
{
Mode = "string",
Status = "string",
},
Assets = new Cloudflare.Inputs.WorkersScriptAssetsArgs
{
Config = new Cloudflare.Inputs.WorkersScriptAssetsConfigArgs
{
_headers = "string",
_redirects = "string",
HtmlHandling = "string",
NotFoundHandling = "string",
RunWorkerFirst = false,
},
Jwt = "string",
},
TailConsumers = new[]
{
new Cloudflare.Inputs.WorkersScriptTailConsumerArgs
{
Service = "string",
Environment = "string",
Namespace = "string",
},
},
UsageModel = "string",
});
example, err := cloudflare.NewWorkersScript(ctx, "workersScriptResource", &cloudflare.WorkersScriptArgs{
Content: pulumi.String("string"),
ScriptName: pulumi.String("string"),
AccountId: pulumi.String("string"),
KeepBindings: pulumi.StringArray{
pulumi.String("string"),
},
MainModule: pulumi.String("string"),
CompatibilityFlags: pulumi.StringArray{
pulumi.String("string"),
},
BodyPart: pulumi.String("string"),
KeepAssets: pulumi.Bool(false),
Bindings: cloudflare.WorkersScriptBindingArray{
&cloudflare.WorkersScriptBindingArgs{
Name: pulumi.String("string"),
Type: pulumi.String("string"),
Environment: pulumi.String("string"),
Namespace: pulumi.String("string"),
BucketName: pulumi.String("string"),
Id: pulumi.String("string"),
IndexName: pulumi.String("string"),
Json: pulumi.String("string"),
ClassName: pulumi.String("string"),
Dataset: pulumi.String("string"),
NamespaceId: pulumi.String("string"),
Outbound: &cloudflare.WorkersScriptBindingOutboundArgs{
Params: pulumi.StringArray{
pulumi.String("string"),
},
Worker: &cloudflare.WorkersScriptBindingOutboundWorkerArgs{
Environment: pulumi.String("string"),
Service: pulumi.String("string"),
},
},
QueueName: pulumi.String("string"),
ScriptName: pulumi.String("string"),
Service: pulumi.String("string"),
Text: pulumi.String("string"),
CertificateId: pulumi.String("string"),
},
},
Logpush: pulumi.Bool(false),
CompatibilityDate: pulumi.String("string"),
Migrations: &cloudflare.WorkersScriptMigrationsArgs{
DeletedClasses: pulumi.StringArray{
pulumi.String("string"),
},
NewClasses: pulumi.StringArray{
pulumi.String("string"),
},
NewSqliteClasses: pulumi.StringArray{
pulumi.String("string"),
},
NewTag: pulumi.String("string"),
OldTag: pulumi.String("string"),
RenamedClasses: cloudflare.WorkersScriptMigrationsRenamedClassArray{
&cloudflare.WorkersScriptMigrationsRenamedClassArgs{
From: pulumi.String("string"),
To: pulumi.String("string"),
},
},
Steps: cloudflare.WorkersScriptMigrationsStepArray{
&cloudflare.WorkersScriptMigrationsStepArgs{
DeletedClasses: pulumi.StringArray{
pulumi.String("string"),
},
NewClasses: pulumi.StringArray{
pulumi.String("string"),
},
NewSqliteClasses: pulumi.StringArray{
pulumi.String("string"),
},
RenamedClasses: cloudflare.WorkersScriptMigrationsStepRenamedClassArray{
&cloudflare.WorkersScriptMigrationsStepRenamedClassArgs{
From: pulumi.String("string"),
To: pulumi.String("string"),
},
},
TransferredClasses: cloudflare.WorkersScriptMigrationsStepTransferredClassArray{
&cloudflare.WorkersScriptMigrationsStepTransferredClassArgs{
From: pulumi.String("string"),
FromScript: pulumi.String("string"),
To: pulumi.String("string"),
},
},
},
},
TransferredClasses: cloudflare.WorkersScriptMigrationsTransferredClassArray{
&cloudflare.WorkersScriptMigrationsTransferredClassArgs{
From: pulumi.String("string"),
FromScript: pulumi.String("string"),
To: pulumi.String("string"),
},
},
},
Observability: &cloudflare.WorkersScriptObservabilityArgs{
Enabled: pulumi.Bool(false),
HeadSamplingRate: pulumi.Float64(0),
},
Placement: &cloudflare.WorkersScriptPlacementArgs{
Mode: pulumi.String("string"),
Status: pulumi.String("string"),
},
Assets: &cloudflare.WorkersScriptAssetsArgs{
Config: &cloudflare.WorkersScriptAssetsConfigArgs{
_headers: pulumi.String("string"),
_redirects: pulumi.String("string"),
HtmlHandling: pulumi.String("string"),
NotFoundHandling: pulumi.String("string"),
RunWorkerFirst: pulumi.Bool(false),
},
Jwt: pulumi.String("string"),
},
TailConsumers: cloudflare.WorkersScriptTailConsumerArray{
&cloudflare.WorkersScriptTailConsumerArgs{
Service: pulumi.String("string"),
Environment: pulumi.String("string"),
Namespace: pulumi.String("string"),
},
},
UsageModel: pulumi.String("string"),
})
var workersScriptResource = new WorkersScript("workersScriptResource", WorkersScriptArgs.builder()
.content("string")
.scriptName("string")
.accountId("string")
.keepBindings("string")
.mainModule("string")
.compatibilityFlags("string")
.bodyPart("string")
.keepAssets(false)
.bindings(WorkersScriptBindingArgs.builder()
.name("string")
.type("string")
.environment("string")
.namespace("string")
.bucketName("string")
.id("string")
.indexName("string")
.json("string")
.className("string")
.dataset("string")
.namespaceId("string")
.outbound(WorkersScriptBindingOutboundArgs.builder()
.params("string")
.worker(WorkersScriptBindingOutboundWorkerArgs.builder()
.environment("string")
.service("string")
.build())
.build())
.queueName("string")
.scriptName("string")
.service("string")
.text("string")
.certificateId("string")
.build())
.logpush(false)
.compatibilityDate("string")
.migrations(WorkersScriptMigrationsArgs.builder()
.deletedClasses("string")
.newClasses("string")
.newSqliteClasses("string")
.newTag("string")
.oldTag("string")
.renamedClasses(WorkersScriptMigrationsRenamedClassArgs.builder()
.from("string")
.to("string")
.build())
.steps(WorkersScriptMigrationsStepArgs.builder()
.deletedClasses("string")
.newClasses("string")
.newSqliteClasses("string")
.renamedClasses(WorkersScriptMigrationsStepRenamedClassArgs.builder()
.from("string")
.to("string")
.build())
.transferredClasses(WorkersScriptMigrationsStepTransferredClassArgs.builder()
.from("string")
.fromScript("string")
.to("string")
.build())
.build())
.transferredClasses(WorkersScriptMigrationsTransferredClassArgs.builder()
.from("string")
.fromScript("string")
.to("string")
.build())
.build())
.observability(WorkersScriptObservabilityArgs.builder()
.enabled(false)
.headSamplingRate(0)
.build())
.placement(WorkersScriptPlacementArgs.builder()
.mode("string")
.status("string")
.build())
.assets(WorkersScriptAssetsArgs.builder()
.config(WorkersScriptAssetsConfigArgs.builder()
._headers("string")
._redirects("string")
.htmlHandling("string")
.notFoundHandling("string")
.runWorkerFirst(false)
.build())
.jwt("string")
.build())
.tailConsumers(WorkersScriptTailConsumerArgs.builder()
.service("string")
.environment("string")
.namespace("string")
.build())
.usageModel("string")
.build());
workers_script_resource = cloudflare.WorkersScript("workersScriptResource",
content="string",
script_name="string",
account_id="string",
keep_bindings=["string"],
main_module="string",
compatibility_flags=["string"],
body_part="string",
keep_assets=False,
bindings=[{
"name": "string",
"type": "string",
"environment": "string",
"namespace": "string",
"bucket_name": "string",
"id": "string",
"index_name": "string",
"json": "string",
"class_name": "string",
"dataset": "string",
"namespace_id": "string",
"outbound": {
"params": ["string"],
"worker": {
"environment": "string",
"service": "string",
},
},
"queue_name": "string",
"script_name": "string",
"service": "string",
"text": "string",
"certificate_id": "string",
}],
logpush=False,
compatibility_date="string",
migrations={
"deleted_classes": ["string"],
"new_classes": ["string"],
"new_sqlite_classes": ["string"],
"new_tag": "string",
"old_tag": "string",
"renamed_classes": [{
"from_": "string",
"to": "string",
}],
"steps": [{
"deleted_classes": ["string"],
"new_classes": ["string"],
"new_sqlite_classes": ["string"],
"renamed_classes": [{
"from_": "string",
"to": "string",
}],
"transferred_classes": [{
"from_": "string",
"from_script": "string",
"to": "string",
}],
}],
"transferred_classes": [{
"from_": "string",
"from_script": "string",
"to": "string",
}],
},
observability={
"enabled": False,
"head_sampling_rate": 0,
},
placement={
"mode": "string",
"status": "string",
},
assets={
"config": {
"_headers": "string",
"_redirects": "string",
"html_handling": "string",
"not_found_handling": "string",
"run_worker_first": False,
},
"jwt": "string",
},
tail_consumers=[{
"service": "string",
"environment": "string",
"namespace": "string",
}],
usage_model="string")
const workersScriptResource = new cloudflare.WorkersScript("workersScriptResource", {
content: "string",
scriptName: "string",
accountId: "string",
keepBindings: ["string"],
mainModule: "string",
compatibilityFlags: ["string"],
bodyPart: "string",
keepAssets: false,
bindings: [{
name: "string",
type: "string",
environment: "string",
namespace: "string",
bucketName: "string",
id: "string",
indexName: "string",
json: "string",
className: "string",
dataset: "string",
namespaceId: "string",
outbound: {
params: ["string"],
worker: {
environment: "string",
service: "string",
},
},
queueName: "string",
scriptName: "string",
service: "string",
text: "string",
certificateId: "string",
}],
logpush: false,
compatibilityDate: "string",
migrations: {
deletedClasses: ["string"],
newClasses: ["string"],
newSqliteClasses: ["string"],
newTag: "string",
oldTag: "string",
renamedClasses: [{
from: "string",
to: "string",
}],
steps: [{
deletedClasses: ["string"],
newClasses: ["string"],
newSqliteClasses: ["string"],
renamedClasses: [{
from: "string",
to: "string",
}],
transferredClasses: [{
from: "string",
fromScript: "string",
to: "string",
}],
}],
transferredClasses: [{
from: "string",
fromScript: "string",
to: "string",
}],
},
observability: {
enabled: false,
headSamplingRate: 0,
},
placement: {
mode: "string",
status: "string",
},
assets: {
config: {
_headers: "string",
_redirects: "string",
htmlHandling: "string",
notFoundHandling: "string",
runWorkerFirst: false,
},
jwt: "string",
},
tailConsumers: [{
service: "string",
environment: "string",
namespace: "string",
}],
usageModel: "string",
});
type: cloudflare:WorkersScript
properties:
accountId: string
assets:
config:
_headers: string
_redirects: string
htmlHandling: string
notFoundHandling: string
runWorkerFirst: false
jwt: string
bindings:
- bucketName: string
certificateId: string
className: string
dataset: string
environment: string
id: string
indexName: string
json: string
name: string
namespace: string
namespaceId: string
outbound:
params:
- string
worker:
environment: string
service: string
queueName: string
scriptName: string
service: string
text: string
type: string
bodyPart: string
compatibilityDate: string
compatibilityFlags:
- string
content: string
keepAssets: false
keepBindings:
- string
logpush: false
mainModule: string
migrations:
deletedClasses:
- string
newClasses:
- string
newSqliteClasses:
- string
newTag: string
oldTag: string
renamedClasses:
- from: string
to: string
steps:
- deletedClasses:
- string
newClasses:
- string
newSqliteClasses:
- string
renamedClasses:
- from: string
to: string
transferredClasses:
- from: string
fromScript: string
to: string
transferredClasses:
- from: string
fromScript: string
to: string
observability:
enabled: false
headSamplingRate: 0
placement:
mode: string
status: string
scriptName: string
tailConsumers:
- environment: string
namespace: string
service: string
usageModel: string
WorkersScript Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The WorkersScript resource accepts the following input properties:
- Account
Id string - Identifier.
- Content string
- Module or Service Worker contents of the Worker.
- Script
Name string - Name of the script, used in URLs and route configuration.
- Assets
Workers
Script Assets - Configuration for assets within a Worker
- Bindings
List<Workers
Script Binding> - 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.
- Body
Part string - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - Compatibility
Date string - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- Compatibility
Flags List<string> - 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
. - Keep
Assets bool - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- Keep
Bindings List<string> - List of binding types to keep from previous_upload.
- Logpush bool
- Whether Logpush is turned on for the Worker.
- Main
Module string - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - Migrations
Workers
Script Migrations - Migrations to apply for Durable Objects associated with this Worker.
- Observability
Workers
Script Observability - Observability settings for the Worker.
- Placement
Workers
Script Placement - Configuration for Smart Placement.
- Tail
Consumers List<WorkersScript Tail Consumer> - List of Workers that will consume logs from the attached Worker.
- Usage
Model string - Usage model for the Worker invocations. Available values: "standard".
- Account
Id string - Identifier.
- Content string
- Module or Service Worker contents of the Worker.
- Script
Name string - Name of the script, used in URLs and route configuration.
- Assets
Workers
Script Assets Args - Configuration for assets within a Worker
- Bindings
[]Workers
Script Binding Args - 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.
- Body
Part string - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - Compatibility
Date string - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- Compatibility
Flags []string - 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
. - Keep
Assets bool - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- Keep
Bindings []string - List of binding types to keep from previous_upload.
- Logpush bool
- Whether Logpush is turned on for the Worker.
- Main
Module string - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - Migrations
Workers
Script Migrations Args - Migrations to apply for Durable Objects associated with this Worker.
- Observability
Workers
Script Observability Args - Observability settings for the Worker.
- Placement
Workers
Script Placement Args - Configuration for Smart Placement.
- Tail
Consumers []WorkersScript Tail Consumer Args - List of Workers that will consume logs from the attached Worker.
- Usage
Model string - Usage model for the Worker invocations. Available values: "standard".
- account
Id String - Identifier.
- content String
- Module or Service Worker contents of the Worker.
- script
Name String - Name of the script, used in URLs and route configuration.
- assets
Workers
Script Assets - Configuration for assets within a Worker
- bindings
List<Workers
Script Binding> - 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.
- body
Part String - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility
Date String - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility
Flags List<String> - 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
. - keep
Assets Boolean - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep
Bindings List<String> - List of binding types to keep from previous_upload.
- logpush Boolean
- Whether Logpush is turned on for the Worker.
- main
Module String - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations
Workers
Script Migrations - Migrations to apply for Durable Objects associated with this Worker.
- observability
Workers
Script Observability - Observability settings for the Worker.
- placement
Workers
Script Placement - Configuration for Smart Placement.
- tail
Consumers List<WorkersScript Tail Consumer> - List of Workers that will consume logs from the attached Worker.
- usage
Model String - Usage model for the Worker invocations. Available values: "standard".
- account
Id string - Identifier.
- content string
- Module or Service Worker contents of the Worker.
- script
Name string - Name of the script, used in URLs and route configuration.
- assets
Workers
Script Assets - Configuration for assets within a Worker
- bindings
Workers
Script Binding[] - 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.
- body
Part string - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility
Date string - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility
Flags string[] - 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
. - keep
Assets boolean - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep
Bindings string[] - List of binding types to keep from previous_upload.
- logpush boolean
- Whether Logpush is turned on for the Worker.
- main
Module string - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations
Workers
Script Migrations - Migrations to apply for Durable Objects associated with this Worker.
- observability
Workers
Script Observability - Observability settings for the Worker.
- placement
Workers
Script Placement - Configuration for Smart Placement.
- tail
Consumers WorkersScript Tail Consumer[] - List of Workers that will consume logs from the attached Worker.
- usage
Model string - Usage model for the Worker invocations. Available values: "standard".
- account_
id str - Identifier.
- content str
- Module or Service Worker contents of the Worker.
- script_
name str - Name of the script, used in URLs and route configuration.
- assets
Workers
Script Assets Args - Configuration for assets within a Worker
- bindings
Sequence[Workers
Script Binding Args] - 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.
- body_
part str - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility_
date str - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility_
flags Sequence[str] - 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
. - keep_
assets bool - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep_
bindings Sequence[str] - List of binding types to keep from previous_upload.
- logpush bool
- Whether Logpush is turned on for the Worker.
- main_
module str - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations
Workers
Script Migrations Args - Migrations to apply for Durable Objects associated with this Worker.
- observability
Workers
Script Observability Args - Observability settings for the Worker.
- placement
Workers
Script Placement Args - Configuration for Smart Placement.
- tail_
consumers Sequence[WorkersScript Tail Consumer Args] - List of Workers that will consume logs from the attached Worker.
- usage_
model str - Usage model for the Worker invocations. Available values: "standard".
- account
Id String - Identifier.
- content String
- Module or Service Worker contents of the Worker.
- script
Name String - Name of the script, used in URLs and route configuration.
- assets Property Map
- Configuration for assets within a Worker
- bindings List<Property Map>
- 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.
- body
Part String - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility
Date String - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility
Flags List<String> - 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
. - keep
Assets Boolean - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep
Bindings List<String> - List of binding types to keep from previous_upload.
- logpush Boolean
- Whether Logpush is turned on for the Worker.
- main
Module String - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations Property Map
- Migrations to apply for Durable Objects associated with this Worker.
- observability Property Map
- Observability settings for the Worker.
- placement Property Map
- Configuration for Smart Placement.
- tail
Consumers List<Property Map> - List of Workers that will consume logs from the attached Worker.
- usage
Model String - Usage model for the Worker invocations. Available values: "standard".
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkersScript resource produces the following output properties:
- Created
On string - When the script was created.
- Etag string
- Hashed script content, can be used in a If-None-Match header when updating.
- Has
Assets bool - Whether a Worker contains assets.
- Has
Modules bool - Whether a Worker contains modules.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - When the script was last modified.
- Startup
Time intMs
- Created
On string - When the script was created.
- Etag string
- Hashed script content, can be used in a If-None-Match header when updating.
- Has
Assets bool - Whether a Worker contains assets.
- Has
Modules bool - Whether a Worker contains modules.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - When the script was last modified.
- Startup
Time intMs
- created
On String - When the script was created.
- etag String
- Hashed script content, can be used in a If-None-Match header when updating.
- has
Assets Boolean - Whether a Worker contains assets.
- has
Modules Boolean - Whether a Worker contains modules.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - When the script was last modified.
- startup
Time IntegerMs
- created
On string - When the script was created.
- etag string
- Hashed script content, can be used in a If-None-Match header when updating.
- has
Assets boolean - Whether a Worker contains assets.
- has
Modules boolean - Whether a Worker contains modules.
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On string - When the script was last modified.
- startup
Time numberMs
- created_
on str - When the script was created.
- etag str
- Hashed script content, can be used in a If-None-Match header when updating.
- has_
assets bool - Whether a Worker contains assets.
- has_
modules bool - Whether a Worker contains modules.
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
on str - When the script was last modified.
- startup_
time_ intms
- created
On String - When the script was created.
- etag String
- Hashed script content, can be used in a If-None-Match header when updating.
- has
Assets Boolean - Whether a Worker contains assets.
- has
Modules Boolean - Whether a Worker contains modules.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - When the script was last modified.
- startup
Time NumberMs
Look up Existing WorkersScript Resource
Get an existing WorkersScript resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WorkersScriptState, opts?: CustomResourceOptions): WorkersScript
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
assets: Optional[WorkersScriptAssetsArgs] = None,
bindings: Optional[Sequence[WorkersScriptBindingArgs]] = None,
body_part: Optional[str] = None,
compatibility_date: Optional[str] = None,
compatibility_flags: Optional[Sequence[str]] = None,
content: Optional[str] = None,
created_on: Optional[str] = None,
etag: Optional[str] = None,
has_assets: Optional[bool] = None,
has_modules: Optional[bool] = None,
keep_assets: Optional[bool] = None,
keep_bindings: Optional[Sequence[str]] = None,
logpush: Optional[bool] = None,
main_module: Optional[str] = None,
migrations: Optional[WorkersScriptMigrationsArgs] = None,
modified_on: Optional[str] = None,
observability: Optional[WorkersScriptObservabilityArgs] = None,
placement: Optional[WorkersScriptPlacementArgs] = None,
script_name: Optional[str] = None,
startup_time_ms: Optional[int] = None,
tail_consumers: Optional[Sequence[WorkersScriptTailConsumerArgs]] = None,
usage_model: Optional[str] = None) -> WorkersScript
func GetWorkersScript(ctx *Context, name string, id IDInput, state *WorkersScriptState, opts ...ResourceOption) (*WorkersScript, error)
public static WorkersScript Get(string name, Input<string> id, WorkersScriptState? state, CustomResourceOptions? opts = null)
public static WorkersScript get(String name, Output<String> id, WorkersScriptState state, CustomResourceOptions options)
resources: _: type: cloudflare:WorkersScript get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Id string - Identifier.
- Assets
Workers
Script Assets - Configuration for assets within a Worker
- Bindings
List<Workers
Script Binding> - 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.
- Body
Part string - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - Compatibility
Date string - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- Compatibility
Flags List<string> - 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
. - Content string
- Module or Service Worker contents of the Worker.
- Created
On string - When the script was created.
- Etag string
- Hashed script content, can be used in a If-None-Match header when updating.
- Has
Assets bool - Whether a Worker contains assets.
- Has
Modules bool - Whether a Worker contains modules.
- Keep
Assets bool - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- Keep
Bindings List<string> - List of binding types to keep from previous_upload.
- Logpush bool
- Whether Logpush is turned on for the Worker.
- Main
Module string - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - Migrations
Workers
Script Migrations - Migrations to apply for Durable Objects associated with this Worker.
- Modified
On string - When the script was last modified.
- Observability
Workers
Script Observability - Observability settings for the Worker.
- Placement
Workers
Script Placement - Configuration for Smart Placement.
- Script
Name string - Name of the script, used in URLs and route configuration.
- Startup
Time intMs - Tail
Consumers List<WorkersScript Tail Consumer> - List of Workers that will consume logs from the attached Worker.
- Usage
Model string - Usage model for the Worker invocations. Available values: "standard".
- Account
Id string - Identifier.
- Assets
Workers
Script Assets Args - Configuration for assets within a Worker
- Bindings
[]Workers
Script Binding Args - 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.
- Body
Part string - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - Compatibility
Date string - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- Compatibility
Flags []string - 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
. - Content string
- Module or Service Worker contents of the Worker.
- Created
On string - When the script was created.
- Etag string
- Hashed script content, can be used in a If-None-Match header when updating.
- Has
Assets bool - Whether a Worker contains assets.
- Has
Modules bool - Whether a Worker contains modules.
- Keep
Assets bool - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- Keep
Bindings []string - List of binding types to keep from previous_upload.
- Logpush bool
- Whether Logpush is turned on for the Worker.
- Main
Module string - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - Migrations
Workers
Script Migrations Args - Migrations to apply for Durable Objects associated with this Worker.
- Modified
On string - When the script was last modified.
- Observability
Workers
Script Observability Args - Observability settings for the Worker.
- Placement
Workers
Script Placement Args - Configuration for Smart Placement.
- Script
Name string - Name of the script, used in URLs and route configuration.
- Startup
Time intMs - Tail
Consumers []WorkersScript Tail Consumer Args - List of Workers that will consume logs from the attached Worker.
- Usage
Model string - Usage model for the Worker invocations. Available values: "standard".
- account
Id String - Identifier.
- assets
Workers
Script Assets - Configuration for assets within a Worker
- bindings
List<Workers
Script Binding> - 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.
- body
Part String - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility
Date String - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility
Flags List<String> - 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
. - content String
- Module or Service Worker contents of the Worker.
- created
On String - When the script was created.
- etag String
- Hashed script content, can be used in a If-None-Match header when updating.
- has
Assets Boolean - Whether a Worker contains assets.
- has
Modules Boolean - Whether a Worker contains modules.
- keep
Assets Boolean - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep
Bindings List<String> - List of binding types to keep from previous_upload.
- logpush Boolean
- Whether Logpush is turned on for the Worker.
- main
Module String - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations
Workers
Script Migrations - Migrations to apply for Durable Objects associated with this Worker.
- modified
On String - When the script was last modified.
- observability
Workers
Script Observability - Observability settings for the Worker.
- placement
Workers
Script Placement - Configuration for Smart Placement.
- script
Name String - Name of the script, used in URLs and route configuration.
- startup
Time IntegerMs - tail
Consumers List<WorkersScript Tail Consumer> - List of Workers that will consume logs from the attached Worker.
- usage
Model String - Usage model for the Worker invocations. Available values: "standard".
- account
Id string - Identifier.
- assets
Workers
Script Assets - Configuration for assets within a Worker
- bindings
Workers
Script Binding[] - 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.
- body
Part string - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility
Date string - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility
Flags string[] - 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
. - content string
- Module or Service Worker contents of the Worker.
- created
On string - When the script was created.
- etag string
- Hashed script content, can be used in a If-None-Match header when updating.
- has
Assets boolean - Whether a Worker contains assets.
- has
Modules boolean - Whether a Worker contains modules.
- keep
Assets boolean - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep
Bindings string[] - List of binding types to keep from previous_upload.
- logpush boolean
- Whether Logpush is turned on for the Worker.
- main
Module string - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations
Workers
Script Migrations - Migrations to apply for Durable Objects associated with this Worker.
- modified
On string - When the script was last modified.
- observability
Workers
Script Observability - Observability settings for the Worker.
- placement
Workers
Script Placement - Configuration for Smart Placement.
- script
Name string - Name of the script, used in URLs and route configuration.
- startup
Time numberMs - tail
Consumers WorkersScript Tail Consumer[] - List of Workers that will consume logs from the attached Worker.
- usage
Model string - Usage model for the Worker invocations. Available values: "standard".
- account_
id str - Identifier.
- assets
Workers
Script Assets Args - Configuration for assets within a Worker
- bindings
Sequence[Workers
Script Binding Args] - 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.
- body_
part str - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility_
date str - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility_
flags Sequence[str] - 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
. - content str
- Module or Service Worker contents of the Worker.
- created_
on str - When the script was created.
- etag str
- Hashed script content, can be used in a If-None-Match header when updating.
- has_
assets bool - Whether a Worker contains assets.
- has_
modules bool - Whether a Worker contains modules.
- keep_
assets bool - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep_
bindings Sequence[str] - List of binding types to keep from previous_upload.
- logpush bool
- Whether Logpush is turned on for the Worker.
- main_
module str - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations
Workers
Script Migrations Args - Migrations to apply for Durable Objects associated with this Worker.
- modified_
on str - When the script was last modified.
- observability
Workers
Script Observability Args - Observability settings for the Worker.
- placement
Workers
Script Placement Args - Configuration for Smart Placement.
- script_
name str - Name of the script, used in URLs and route configuration.
- startup_
time_ intms - tail_
consumers Sequence[WorkersScript Tail Consumer Args] - List of Workers that will consume logs from the attached Worker.
- usage_
model str - Usage model for the Worker invocations. Available values: "standard".
- account
Id String - Identifier.
- assets Property Map
- Configuration for assets within a Worker
- bindings List<Property Map>
- 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.
- body
Part String - Name of the part in the multipart request that contains the script (e.g. the file adding a listener to the
fetch
event). Indicates aservice worker syntax
Worker. - compatibility
Date String - Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
- compatibility
Flags List<String> - 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
. - content String
- Module or Service Worker contents of the Worker.
- created
On String - When the script was created.
- etag String
- Hashed script content, can be used in a If-None-Match header when updating.
- has
Assets Boolean - Whether a Worker contains assets.
- has
Modules Boolean - Whether a Worker contains modules.
- keep
Assets Boolean - Retain assets which exist for a previously uploaded Worker version; used in lieu of providing a completion token.
- keep
Bindings List<String> - List of binding types to keep from previous_upload.
- logpush Boolean
- Whether Logpush is turned on for the Worker.
- main
Module String - Name of the part in the multipart request that contains the main module (e.g. the file exporting a
fetch
handler). Indicates amodule syntax
Worker. - migrations Property Map
- Migrations to apply for Durable Objects associated with this Worker.
- modified
On String - When the script was last modified.
- observability Property Map
- Observability settings for the Worker.
- placement Property Map
- Configuration for Smart Placement.
- script
Name String - Name of the script, used in URLs and route configuration.
- startup
Time NumberMs - tail
Consumers List<Property Map> - List of Workers that will consume logs from the attached Worker.
- usage
Model String - Usage model for the Worker invocations. Available values: "standard".
Supporting Types
WorkersScriptAssets, WorkersScriptAssetsArgs
- Config
Workers
Script Assets Config - Configuration for assets within a Worker.
- Jwt string
- Token provided upon successful upload of all files from a registered manifest.
- Config
Workers
Script Assets Config - Configuration for assets within a Worker.
- Jwt string
- Token provided upon successful upload of all files from a registered manifest.
- config
Workers
Script Assets Config - Configuration for assets within a Worker.
- jwt String
- Token provided upon successful upload of all files from a registered manifest.
- config
Workers
Script Assets Config - Configuration for assets within a Worker.
- jwt string
- Token provided upon successful upload of all files from a registered manifest.
- config
Workers
Script Assets Config - Configuration for assets within a Worker.
- jwt str
- Token provided upon successful upload of all files from a registered manifest.
- config Property Map
- Configuration for assets within a Worker.
- jwt String
- Token provided upon successful upload of all files from a registered manifest.
WorkersScriptAssetsConfig, WorkersScriptAssetsConfigArgs
- Html
Handling string - Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".
- Not
Found stringHandling - Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".
- Run
Worker boolFirst - When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.
- Serve
Directly bool - When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.
- _
headers string - The contents of a _headers file (used to attach custom headers on asset responses)
- _
redirects string - The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)
- Html
Handling string - Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".
- Not
Found stringHandling - Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".
- Run
Worker boolFirst - When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.
- Serve
Directly bool - When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.
- _
headers string - The contents of a _headers file (used to attach custom headers on asset responses)
- _
redirects string - The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)
- _
headers String - The contents of a _headers file (used to attach custom headers on asset responses)
- _
redirects String - The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)
- html
Handling String - Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".
- not
Found StringHandling - Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".
- run
Worker BooleanFirst - When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.
- serve
Directly Boolean - When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.
- _
headers string - The contents of a _headers file (used to attach custom headers on asset responses)
- _
redirects string - The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)
- html
Handling string - Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".
- not
Found stringHandling - Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".
- run
Worker booleanFirst - When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.
- serve
Directly boolean - When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.
- _
headers str - The contents of a _headers file (used to attach custom headers on asset responses)
- _
redirects str - The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)
- html_
handling str - Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".
- not_
found_ strhandling - Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".
- run_
worker_ boolfirst - When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.
- serve_
directly bool - When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.
- _
headers String - The contents of a _headers file (used to attach custom headers on asset responses)
- _
redirects String - The contents of a _redirects file (used to apply redirects or proxy paths ahead of asset serving)
- html
Handling String - Determines the redirects and rewrites of requests for HTML content. Available values: "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none".
- not
Found StringHandling - Determines the response when a request does not match a static asset, and there is no Worker script. Available values: "none", "404-page", "single-page-application".
- run
Worker BooleanFirst - When true, requests will always invoke the Worker script. Otherwise, attempt to serve an asset matching the request, falling back to the Worker script.
- serve
Directly Boolean - When true and the incoming request matches an asset, that will be served instead of invoking the Worker script. When false, requests will always invoke the Worker script.
WorkersScriptBinding, WorkersScriptBindingArgs
- Name string
- A JavaScript variable name for the binding.
- Type string
- The kind of resource that the binding provides. Available values: "ai", "analyticsengine", "assets", "browserrendering", "d1", "dispatchnamespace", "durableobjectnamespace", "hyperdrive", "json", "kvnamespace", "mtlscertificate", "plaintext", "queue", "r2bucket", "secrettext", "service", "tailconsumer", "vectorize", "versionmetadata".
- Bucket
Name string - R2 bucket to bind to.
- Certificate
Id string - Identifier of the certificate to bind to.
- Class
Name string - The exported class name of the Durable Object.
- Dataset string
- The name of the dataset to bind to.
- Environment string
- The environment of the script_name to bind to.
- Id string
- Identifier of the D1 database to bind to.
- Index
Name string - Name of the Vectorize index to bind to.
- Json string
- JSON data to use.
- Namespace string
- Namespace to bind to.
- Namespace
Id string - Namespace identifier tag.
- Outbound
Workers
Script Binding Outbound - Outbound worker.
- Queue
Name string - Name of the Queue to bind to.
- Script
Name string - The script where the Durable Object is defined, if it is external to this Worker.
- Service string
- Name of Worker to bind to.
- Text string
- The text value to use.
- Name string
- A JavaScript variable name for the binding.
- Type string
- The kind of resource that the binding provides. Available values: "ai", "analyticsengine", "assets", "browserrendering", "d1", "dispatchnamespace", "durableobjectnamespace", "hyperdrive", "json", "kvnamespace", "mtlscertificate", "plaintext", "queue", "r2bucket", "secrettext", "service", "tailconsumer", "vectorize", "versionmetadata".
- Bucket
Name string - R2 bucket to bind to.
- Certificate
Id string - Identifier of the certificate to bind to.
- Class
Name string - The exported class name of the Durable Object.
- Dataset string
- The name of the dataset to bind to.
- Environment string
- The environment of the script_name to bind to.
- Id string
- Identifier of the D1 database to bind to.
- Index
Name string - Name of the Vectorize index to bind to.
- Json string
- JSON data to use.
- Namespace string
- Namespace to bind to.
- Namespace
Id string - Namespace identifier tag.
- Outbound
Workers
Script Binding Outbound - Outbound worker.
- Queue
Name string - Name of the Queue to bind to.
- Script
Name string - The script where the Durable Object is defined, if it is external to this Worker.
- Service string
- Name of Worker to bind to.
- Text string
- The text value to use.
- name String
- A JavaScript variable name for the binding.
- type String
- The kind of resource that the binding provides. Available values: "ai", "analyticsengine", "assets", "browserrendering", "d1", "dispatchnamespace", "durableobjectnamespace", "hyperdrive", "json", "kvnamespace", "mtlscertificate", "plaintext", "queue", "r2bucket", "secrettext", "service", "tailconsumer", "vectorize", "versionmetadata".
- bucket
Name String - R2 bucket to bind to.
- certificate
Id String - Identifier of the certificate to bind to.
- class
Name String - The exported class name of the Durable Object.
- dataset String
- The name of the dataset to bind to.
- environment String
- The environment of the script_name to bind to.
- id String
- Identifier of the D1 database to bind to.
- index
Name String - Name of the Vectorize index to bind to.
- json String
- JSON data to use.
- namespace String
- Namespace to bind to.
- namespace
Id String - Namespace identifier tag.
- outbound
Workers
Script Binding Outbound - Outbound worker.
- queue
Name String - Name of the Queue to bind to.
- script
Name String - The script where the Durable Object is defined, if it is external to this Worker.
- service String
- Name of Worker to bind to.
- text String
- The text value to use.
- name string
- A JavaScript variable name for the binding.
- type string
- The kind of resource that the binding provides. Available values: "ai", "analyticsengine", "assets", "browserrendering", "d1", "dispatchnamespace", "durableobjectnamespace", "hyperdrive", "json", "kvnamespace", "mtlscertificate", "plaintext", "queue", "r2bucket", "secrettext", "service", "tailconsumer", "vectorize", "versionmetadata".
- bucket
Name string - R2 bucket to bind to.
- certificate
Id string - Identifier of the certificate to bind to.
- class
Name string - The exported class name of the Durable Object.
- dataset string
- The name of the dataset to bind to.
- environment string
- The environment of the script_name to bind to.
- id string
- Identifier of the D1 database to bind to.
- index
Name string - Name of the Vectorize index to bind to.
- json string
- JSON data to use.
- namespace string
- Namespace to bind to.
- namespace
Id string - Namespace identifier tag.
- outbound
Workers
Script Binding Outbound - Outbound worker.
- queue
Name string - Name of the Queue to bind to.
- script
Name string - The script where the Durable Object is defined, if it is external to this Worker.
- service string
- Name of Worker to bind to.
- text string
- The text value to use.
- name str
- A JavaScript variable name for the binding.
- type str
- The kind of resource that the binding provides. Available values: "ai", "analyticsengine", "assets", "browserrendering", "d1", "dispatchnamespace", "durableobjectnamespace", "hyperdrive", "json", "kvnamespace", "mtlscertificate", "plaintext", "queue", "r2bucket", "secrettext", "service", "tailconsumer", "vectorize", "versionmetadata".
- bucket_
name str - R2 bucket to bind to.
- certificate_
id str - Identifier of the certificate to bind to.
- class_
name str - The exported class name of the Durable Object.
- dataset str
- The name of the dataset to bind to.
- environment str
- The environment of the script_name to bind to.
- id str
- Identifier of the D1 database to bind to.
- index_
name str - Name of the Vectorize index to bind to.
- json str
- JSON data to use.
- namespace str
- Namespace to bind to.
- namespace_
id str - Namespace identifier tag.
- outbound
Workers
Script Binding Outbound - Outbound worker.
- queue_
name str - Name of the Queue to bind to.
- script_
name str - The script where the Durable Object is defined, if it is external to this Worker.
- service str
- Name of Worker to bind to.
- text str
- The text value to use.
- name String
- A JavaScript variable name for the binding.
- type String
- The kind of resource that the binding provides. Available values: "ai", "analyticsengine", "assets", "browserrendering", "d1", "dispatchnamespace", "durableobjectnamespace", "hyperdrive", "json", "kvnamespace", "mtlscertificate", "plaintext", "queue", "r2bucket", "secrettext", "service", "tailconsumer", "vectorize", "versionmetadata".
- bucket
Name String - R2 bucket to bind to.
- certificate
Id String - Identifier of the certificate to bind to.
- class
Name String - The exported class name of the Durable Object.
- dataset String
- The name of the dataset to bind to.
- environment String
- The environment of the script_name to bind to.
- id String
- Identifier of the D1 database to bind to.
- index
Name String - Name of the Vectorize index to bind to.
- json String
- JSON data to use.
- namespace String
- Namespace to bind to.
- namespace
Id String - Namespace identifier tag.
- outbound Property Map
- Outbound worker.
- queue
Name String - Name of the Queue to bind to.
- script
Name String - The script where the Durable Object is defined, if it is external to this Worker.
- service String
- Name of Worker to bind to.
- text String
- The text value to use.
WorkersScriptBindingOutbound, WorkersScriptBindingOutboundArgs
- Params List<string>
- Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
- Worker
Workers
Script Binding Outbound Worker - Outbound worker.
- Params []string
- Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
- Worker
Workers
Script Binding Outbound Worker - Outbound worker.
- params List<String>
- Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
- worker
Workers
Script Binding Outbound Worker - Outbound worker.
- params string[]
- Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
- worker
Workers
Script Binding Outbound Worker - Outbound worker.
- params Sequence[str]
- Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
- worker
Workers
Script Binding Outbound Worker - Outbound worker.
- params List<String>
- Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
- worker Property Map
- Outbound worker.
WorkersScriptBindingOutboundWorker, WorkersScriptBindingOutboundWorkerArgs
- Environment string
- Environment of the outbound worker.
- Service string
- Name of the outbound worker.
- Environment string
- Environment of the outbound worker.
- Service string
- Name of the outbound worker.
- environment String
- Environment of the outbound worker.
- service String
- Name of the outbound worker.
- environment string
- Environment of the outbound worker.
- service string
- Name of the outbound worker.
- environment str
- Environment of the outbound worker.
- service str
- Name of the outbound worker.
- environment String
- Environment of the outbound worker.
- service String
- Name of the outbound worker.
WorkersScriptMigrations, WorkersScriptMigrationsArgs
- Deleted
Classes List<string> - A list of classes to delete Durable Object namespaces from.
- New
Classes List<string> - A list of classes to create Durable Object namespaces from.
- New
Sqlite List<string>Classes - A list of classes to create Durable Object namespaces with SQLite from.
- New
Tag string - Tag to set as the latest migration tag.
- Old
Tag string - Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
- Renamed
Classes List<WorkersScript Migrations Renamed Class> - A list of classes with Durable Object namespaces that were renamed.
- Steps
List<Workers
Script Migrations Step> - Migrations to apply in order.
- Transferred
Classes List<WorkersScript Migrations Transferred Class> - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- Deleted
Classes []string - A list of classes to delete Durable Object namespaces from.
- New
Classes []string - A list of classes to create Durable Object namespaces from.
- New
Sqlite []stringClasses - A list of classes to create Durable Object namespaces with SQLite from.
- New
Tag string - Tag to set as the latest migration tag.
- Old
Tag string - Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
- Renamed
Classes []WorkersScript Migrations Renamed Class - A list of classes with Durable Object namespaces that were renamed.
- Steps
[]Workers
Script Migrations Step - Migrations to apply in order.
- Transferred
Classes []WorkersScript Migrations Transferred Class - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted
Classes List<String> - A list of classes to delete Durable Object namespaces from.
- new
Classes List<String> - A list of classes to create Durable Object namespaces from.
- new
Sqlite List<String>Classes - A list of classes to create Durable Object namespaces with SQLite from.
- new
Tag String - Tag to set as the latest migration tag.
- old
Tag String - Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
- renamed
Classes List<WorkersScript Migrations Renamed Class> - A list of classes with Durable Object namespaces that were renamed.
- steps
List<Workers
Script Migrations Step> - Migrations to apply in order.
- transferred
Classes List<WorkersScript Migrations Transferred Class> - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted
Classes string[] - A list of classes to delete Durable Object namespaces from.
- new
Classes string[] - A list of classes to create Durable Object namespaces from.
- new
Sqlite string[]Classes - A list of classes to create Durable Object namespaces with SQLite from.
- new
Tag string - Tag to set as the latest migration tag.
- old
Tag string - Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
- renamed
Classes WorkersScript Migrations Renamed Class[] - A list of classes with Durable Object namespaces that were renamed.
- steps
Workers
Script Migrations Step[] - Migrations to apply in order.
- transferred
Classes WorkersScript Migrations Transferred Class[] - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted_
classes Sequence[str] - A list of classes to delete Durable Object namespaces from.
- new_
classes Sequence[str] - A list of classes to create Durable Object namespaces from.
- new_
sqlite_ Sequence[str]classes - A list of classes to create Durable Object namespaces with SQLite from.
- new_
tag str - Tag to set as the latest migration tag.
- old_
tag str - Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
- renamed_
classes Sequence[WorkersScript Migrations Renamed Class] - A list of classes with Durable Object namespaces that were renamed.
- steps
Sequence[Workers
Script Migrations Step] - Migrations to apply in order.
- transferred_
classes Sequence[WorkersScript Migrations Transferred Class] - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted
Classes List<String> - A list of classes to delete Durable Object namespaces from.
- new
Classes List<String> - A list of classes to create Durable Object namespaces from.
- new
Sqlite List<String>Classes - A list of classes to create Durable Object namespaces with SQLite from.
- new
Tag String - Tag to set as the latest migration tag.
- old
Tag String - Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.
- renamed
Classes List<Property Map> - A list of classes with Durable Object namespaces that were renamed.
- steps List<Property Map>
- Migrations to apply in order.
- transferred
Classes List<Property Map> - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
WorkersScriptMigrationsRenamedClass, WorkersScriptMigrationsRenamedClassArgs
WorkersScriptMigrationsStep, WorkersScriptMigrationsStepArgs
- Deleted
Classes List<string> - A list of classes to delete Durable Object namespaces from.
- New
Classes List<string> - A list of classes to create Durable Object namespaces from.
- New
Sqlite List<string>Classes - A list of classes to create Durable Object namespaces with SQLite from.
- Renamed
Classes List<WorkersScript Migrations Step Renamed Class> - A list of classes with Durable Object namespaces that were renamed.
- Transferred
Classes List<WorkersScript Migrations Step Transferred Class> - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- Deleted
Classes []string - A list of classes to delete Durable Object namespaces from.
- New
Classes []string - A list of classes to create Durable Object namespaces from.
- New
Sqlite []stringClasses - A list of classes to create Durable Object namespaces with SQLite from.
- Renamed
Classes []WorkersScript Migrations Step Renamed Class - A list of classes with Durable Object namespaces that were renamed.
- Transferred
Classes []WorkersScript Migrations Step Transferred Class - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted
Classes List<String> - A list of classes to delete Durable Object namespaces from.
- new
Classes List<String> - A list of classes to create Durable Object namespaces from.
- new
Sqlite List<String>Classes - A list of classes to create Durable Object namespaces with SQLite from.
- renamed
Classes List<WorkersScript Migrations Step Renamed Class> - A list of classes with Durable Object namespaces that were renamed.
- transferred
Classes List<WorkersScript Migrations Step Transferred Class> - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted
Classes string[] - A list of classes to delete Durable Object namespaces from.
- new
Classes string[] - A list of classes to create Durable Object namespaces from.
- new
Sqlite string[]Classes - A list of classes to create Durable Object namespaces with SQLite from.
- renamed
Classes WorkersScript Migrations Step Renamed Class[] - A list of classes with Durable Object namespaces that were renamed.
- transferred
Classes WorkersScript Migrations Step Transferred Class[] - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted_
classes Sequence[str] - A list of classes to delete Durable Object namespaces from.
- new_
classes Sequence[str] - A list of classes to create Durable Object namespaces from.
- new_
sqlite_ Sequence[str]classes - A list of classes to create Durable Object namespaces with SQLite from.
- renamed_
classes Sequence[WorkersScript Migrations Step Renamed Class] - A list of classes with Durable Object namespaces that were renamed.
- transferred_
classes Sequence[WorkersScript Migrations Step Transferred Class] - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
- deleted
Classes List<String> - A list of classes to delete Durable Object namespaces from.
- new
Classes List<String> - A list of classes to create Durable Object namespaces from.
- new
Sqlite List<String>Classes - A list of classes to create Durable Object namespaces with SQLite from.
- renamed
Classes List<Property Map> - A list of classes with Durable Object namespaces that were renamed.
- transferred
Classes List<Property Map> - A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.
WorkersScriptMigrationsStepRenamedClass, WorkersScriptMigrationsStepRenamedClassArgs
WorkersScriptMigrationsStepTransferredClass, WorkersScriptMigrationsStepTransferredClassArgs
- From string
- From
Script string - To string
- From string
- From
Script string - To string
- from String
- from
Script String - to String
- from string
- from
Script string - to string
- from_ str
- from_
script str - to str
- from String
- from
Script String - to String
WorkersScriptMigrationsTransferredClass, WorkersScriptMigrationsTransferredClassArgs
- From string
- From
Script string - To string
- From string
- From
Script string - To string
- from String
- from
Script String - to String
- from string
- from
Script string - to string
- from_ str
- from_
script str - to str
- from String
- from
Script String - to String
WorkersScriptObservability, WorkersScriptObservabilityArgs
- Enabled bool
- Whether observability is enabled for the Worker.
- Head
Sampling doubleRate - The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.
- Enabled bool
- Whether observability is enabled for the Worker.
- Head
Sampling float64Rate - The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.
- enabled Boolean
- Whether observability is enabled for the Worker.
- head
Sampling DoubleRate - The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.
- enabled boolean
- Whether observability is enabled for the Worker.
- head
Sampling numberRate - The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.
- enabled bool
- Whether observability is enabled for the Worker.
- head_
sampling_ floatrate - The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.
- enabled Boolean
- Whether observability is enabled for the Worker.
- head
Sampling NumberRate - The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.
WorkersScriptPlacement, WorkersScriptPlacementArgs
- Mode string
- Enables Smart Placement. Available values: "smart".
- Status string
- Status of Smart Placement. Available values: "SUCCESS", "UNSUPPORTEDAPPLICATION", "INSUFFICIENTINVOCATIONS".
- Mode string
- Enables Smart Placement. Available values: "smart".
- Status string
- Status of Smart Placement. Available values: "SUCCESS", "UNSUPPORTEDAPPLICATION", "INSUFFICIENTINVOCATIONS".
- mode String
- Enables Smart Placement. Available values: "smart".
- status String
- Status of Smart Placement. Available values: "SUCCESS", "UNSUPPORTEDAPPLICATION", "INSUFFICIENTINVOCATIONS".
- mode string
- Enables Smart Placement. Available values: "smart".
- status string
- Status of Smart Placement. Available values: "SUCCESS", "UNSUPPORTEDAPPLICATION", "INSUFFICIENTINVOCATIONS".
- mode str
- Enables Smart Placement. Available values: "smart".
- status str
- Status of Smart Placement. Available values: "SUCCESS", "UNSUPPORTEDAPPLICATION", "INSUFFICIENTINVOCATIONS".
- mode String
- Enables Smart Placement. Available values: "smart".
- status String
- Status of Smart Placement. Available values: "SUCCESS", "UNSUPPORTEDAPPLICATION", "INSUFFICIENTINVOCATIONS".
WorkersScriptTailConsumer, WorkersScriptTailConsumerArgs
- Service string
- Name of Worker that is to be the consumer.
- Environment string
- Optional environment if the Worker utilizes one.
- Namespace string
- Optional dispatch namespace the script belongs to.
- Service string
- Name of Worker that is to be the consumer.
- Environment string
- Optional environment if the Worker utilizes one.
- Namespace string
- Optional dispatch namespace the script belongs to.
- service String
- Name of Worker that is to be the consumer.
- environment String
- Optional environment if the Worker utilizes one.
- namespace String
- Optional dispatch namespace the script belongs to.
- service string
- Name of Worker that is to be the consumer.
- environment string
- Optional environment if the Worker utilizes one.
- namespace string
- Optional dispatch namespace the script belongs to.
- service str
- Name of Worker that is to be the consumer.
- environment str
- Optional environment if the Worker utilizes one.
- namespace str
- Optional dispatch namespace the script belongs to.
- service String
- Name of Worker that is to be the consumer.
- environment String
- Optional environment if the Worker utilizes one.
- namespace String
- Optional dispatch namespace the script belongs to.
Import
$ pulumi import cloudflare:index/workersScript:WorkersScript example '<account_id>/<script_name>'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.