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
new WorkerScript(name: string, args: WorkerScriptArgs, opts?: CustomResourceOptions);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)public WorkerScript(string name, WorkerScriptArgs args, CustomResourceOptions? opts = null)- 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.
- Kv
Namespace List<WorkerBindings Script Kv Namespace Binding Args> - Plain
Text List<WorkerBindings Script Plain Text Binding Args> - Secret
Text List<WorkerBindings Script Secret Text Binding Args>
- Content string
The script content.
- Name string
The global variable for the binding in your Worker code.
- Kv
Namespace []WorkerBindings Script Kv Namespace Binding - Plain
Text []WorkerBindings Script Plain Text Binding - Secret
Text []WorkerBindings Script Secret Text Binding
- content string
The script content.
- name string
The global variable for the binding in your Worker code.
- kv
Namespace WorkerBindings Script Kv Namespace Binding[] - plain
Text WorkerBindings Script Plain Text Binding[] - secret
Text WorkerBindings Script Secret Text Binding[]
- content str
The script content.
- name str
The global variable for the binding in your Worker code.
- kv_
namespace_ List[Workerbindings Script Kv Namespace Binding] - plain_
text_ List[Workerbindings Script Plain Text Binding] - secret_
text_ List[Workerbindings Script Secret Text Binding]
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkerScript resource produces the following output properties:
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): WorkerScriptstatic 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.
- Kv
Namespace List<WorkerBindings Script Kv Namespace Binding Args> - Name string
The global variable for the binding in your Worker code.
- Plain
Text List<WorkerBindings Script Plain Text Binding Args> - Secret
Text List<WorkerBindings Script Secret Text Binding Args>
- Content string
The script content.
- Kv
Namespace []WorkerBindings Script Kv Namespace Binding - Name string
The global variable for the binding in your Worker code.
- Plain
Text []WorkerBindings Script Plain Text Binding - Secret
Text []WorkerBindings Script Secret Text Binding
- content string
The script content.
- kv
Namespace WorkerBindings Script Kv Namespace Binding[] - name string
The global variable for the binding in your Worker code.
- plain
Text WorkerBindings Script Plain Text Binding[] - secret
Text WorkerBindings Script Secret Text Binding[]
- content str
The script content.
- kv_
namespace_ List[Workerbindings Script Kv Namespace Binding] - name str
The global variable for the binding in your Worker code.
- plain_
text_ List[Workerbindings Script Plain Text Binding] - secret_
text_ List[Workerbindings Script Secret Text Binding]
Supporting Types
WorkerScriptKvNamespaceBinding
- Name string
The global variable for the binding in your Worker code.
- Namespace
Id string
- Name string
The global variable for the binding in your Worker code.
- Namespace
Id string
- name string
The global variable for the binding in your Worker code.
- namespace
Id string
- name str
The global variable for the binding in your Worker code.
- namespace_
id str
WorkerScriptPlainTextBinding
WorkerScriptSecretTextBinding
Package Details
- Repository
- https://github.com/pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflareTerraform Provider.