WorkerScript

Provides a Cloudflare worker script resource. In order for a script to be active, you’ll also need to setup a cloudflare..WorkerRoute. NOTE: This resource uses the Cloudflare account APIs. This requires setting the CLOUDFLARE_ACCOUNT_ID environment variable or account_id provider argument.

Create a WorkerScript Resource

def WorkerScript(resource_name, opts=None, content=None, kv_namespace_bindings=None, name=None, plain_text_bindings=None, secret_text_bindings=None, __props__=None);
func NewWorkerScript(ctx *Context, name string, args WorkerScriptArgs, opts ...ResourceOption) (*WorkerScript, error)
name string
The unique name of the resource.
args WorkerScriptArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args WorkerScriptArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args WorkerScriptArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

WorkerScript Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The WorkerScript resource accepts the following input properties:

Content string

The script content.

Name string

The global variable for the binding in your Worker code.

KvNamespaceBindings List<WorkerScriptKvNamespaceBindingArgs>
PlainTextBindings List<WorkerScriptPlainTextBindingArgs>
SecretTextBindings List<WorkerScriptSecretTextBindingArgs>
Content string

The script content.

Name string

The global variable for the binding in your Worker code.

KvNamespaceBindings []WorkerScriptKvNamespaceBinding
PlainTextBindings []WorkerScriptPlainTextBinding
SecretTextBindings []WorkerScriptSecretTextBinding
content string

The script content.

name string

The global variable for the binding in your Worker code.

kvNamespaceBindings WorkerScriptKvNamespaceBinding[]
plainTextBindings WorkerScriptPlainTextBinding[]
secretTextBindings WorkerScriptSecretTextBinding[]
content str

The script content.

name str

The global variable for the binding in your Worker code.

kv_namespace_bindings List[WorkerScriptKvNamespaceBinding]
plain_text_bindings List[WorkerScriptPlainTextBinding]
secret_text_bindings List[WorkerScriptSecretTextBinding]

Outputs

All input properties are implicitly available as output properties. Additionally, the WorkerScript resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing WorkerScript Resource

Get an existing WorkerScript 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?: WorkerScriptState, opts?: CustomResourceOptions): WorkerScript
static get(resource_name, id, opts=None, content=None, kv_namespace_bindings=None, name=None, plain_text_bindings=None, secret_text_bindings=None, __props__=None);
func GetWorkerScript(ctx *Context, name string, id IDInput, state *WorkerScriptState, opts ...ResourceOption) (*WorkerScript, error)
public static WorkerScript Get(string name, Input<string> id, WorkerScriptState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Content string

The script content.

KvNamespaceBindings List<WorkerScriptKvNamespaceBindingArgs>
Name string

The global variable for the binding in your Worker code.

PlainTextBindings List<WorkerScriptPlainTextBindingArgs>
SecretTextBindings List<WorkerScriptSecretTextBindingArgs>
Content string

The script content.

KvNamespaceBindings []WorkerScriptKvNamespaceBinding
Name string

The global variable for the binding in your Worker code.

PlainTextBindings []WorkerScriptPlainTextBinding
SecretTextBindings []WorkerScriptSecretTextBinding
content string

The script content.

kvNamespaceBindings WorkerScriptKvNamespaceBinding[]
name string

The global variable for the binding in your Worker code.

plainTextBindings WorkerScriptPlainTextBinding[]
secretTextBindings WorkerScriptSecretTextBinding[]
content str

The script content.

kv_namespace_bindings List[WorkerScriptKvNamespaceBinding]
name str

The global variable for the binding in your Worker code.

plain_text_bindings List[WorkerScriptPlainTextBinding]
secret_text_bindings List[WorkerScriptSecretTextBinding]

Supporting Types

WorkerScriptKvNamespaceBinding

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

The global variable for the binding in your Worker code.

NamespaceId string
Name string

The global variable for the binding in your Worker code.

NamespaceId string
name string

The global variable for the binding in your Worker code.

namespaceId string
name str

The global variable for the binding in your Worker code.

namespace_id str

WorkerScriptPlainTextBinding

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

The global variable for the binding in your Worker code.

Text string

The secret text you want to store.

Name string

The global variable for the binding in your Worker code.

Text string

The secret text you want to store.

name string

The global variable for the binding in your Worker code.

text string

The secret text you want to store.

name str

The global variable for the binding in your Worker code.

text str

The secret text you want to store.

WorkerScriptSecretTextBinding

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string

The global variable for the binding in your Worker code.

Text string

The secret text you want to store.

Name string

The global variable for the binding in your Worker code.

Text string

The secret text you want to store.

name string

The global variable for the binding in your Worker code.

text string

The secret text you want to store.

name str

The global variable for the binding in your Worker code.

text str

The secret text you want to store.

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.