1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WorkersDeployment
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.WorkersDeployment

Explore with Pulumi AI

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  exampleWorkersDeployment:
    type: cloudflare:WorkersDeployment
    name: example_workers_deployment
    properties:
      accountId: 023e105f4ecef8ad9ca31a8372d0c353
      scriptName: this-is_my_script-01
      strategy: percentage
      versions:
        - percentage: 100
          version_id: bcf48806-b317-4351-9ee7-36e7d557d4de
      annotations:
        workers_message: Deploy bug fix.
Copy

Create WorkersDeployment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new WorkersDeployment(name: string, args: WorkersDeploymentArgs, opts?: CustomResourceOptions);
@overload
def WorkersDeployment(resource_name: str,
                      args: WorkersDeploymentArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def WorkersDeployment(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      account_id: Optional[str] = None,
                      script_name: Optional[str] = None,
                      strategy: Optional[str] = None,
                      versions: Optional[Sequence[WorkersDeploymentVersionArgs]] = None,
                      annotations: Optional[WorkersDeploymentAnnotationsArgs] = None)
func NewWorkersDeployment(ctx *Context, name string, args WorkersDeploymentArgs, opts ...ResourceOption) (*WorkersDeployment, error)
public WorkersDeployment(string name, WorkersDeploymentArgs args, CustomResourceOptions? opts = null)
public WorkersDeployment(String name, WorkersDeploymentArgs args)
public WorkersDeployment(String name, WorkersDeploymentArgs args, CustomResourceOptions options)
type: cloudflare:WorkersDeployment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WorkersDeploymentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WorkersDeploymentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WorkersDeploymentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WorkersDeploymentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WorkersDeploymentArgs
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 workersDeploymentResource = new Cloudflare.WorkersDeployment("workersDeploymentResource", new()
{
    AccountId = "string",
    ScriptName = "string",
    Strategy = "string",
    Versions = new[]
    {
        new Cloudflare.Inputs.WorkersDeploymentVersionArgs
        {
            Percentage = 0,
            VersionId = "string",
        },
    },
    Annotations = new Cloudflare.Inputs.WorkersDeploymentAnnotationsArgs
    {
        WorkersMessage = "string",
    },
});
Copy
example, err := cloudflare.NewWorkersDeployment(ctx, "workersDeploymentResource", &cloudflare.WorkersDeploymentArgs{
	AccountId:  pulumi.String("string"),
	ScriptName: pulumi.String("string"),
	Strategy:   pulumi.String("string"),
	Versions: cloudflare.WorkersDeploymentVersionArray{
		&cloudflare.WorkersDeploymentVersionArgs{
			Percentage: pulumi.Float64(0),
			VersionId:  pulumi.String("string"),
		},
	},
	Annotations: &cloudflare.WorkersDeploymentAnnotationsArgs{
		WorkersMessage: pulumi.String("string"),
	},
})
Copy
var workersDeploymentResource = new WorkersDeployment("workersDeploymentResource", WorkersDeploymentArgs.builder()
    .accountId("string")
    .scriptName("string")
    .strategy("string")
    .versions(WorkersDeploymentVersionArgs.builder()
        .percentage(0)
        .versionId("string")
        .build())
    .annotations(WorkersDeploymentAnnotationsArgs.builder()
        .workersMessage("string")
        .build())
    .build());
Copy
workers_deployment_resource = cloudflare.WorkersDeployment("workersDeploymentResource",
    account_id="string",
    script_name="string",
    strategy="string",
    versions=[{
        "percentage": 0,
        "version_id": "string",
    }],
    annotations={
        "workers_message": "string",
    })
Copy
const workersDeploymentResource = new cloudflare.WorkersDeployment("workersDeploymentResource", {
    accountId: "string",
    scriptName: "string",
    strategy: "string",
    versions: [{
        percentage: 0,
        versionId: "string",
    }],
    annotations: {
        workersMessage: "string",
    },
});
Copy
type: cloudflare:WorkersDeployment
properties:
    accountId: string
    annotations:
        workersMessage: string
    scriptName: string
    strategy: string
    versions:
        - percentage: 0
          versionId: string
Copy

WorkersDeployment 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 WorkersDeployment resource accepts the following input properties:

AccountId This property is required. string
Identifier
ScriptName This property is required. string
Name of the script.
Strategy This property is required. string
Available values: "percentage".
Versions This property is required. List<WorkersDeploymentVersion>
Annotations WorkersDeploymentAnnotations
AccountId This property is required. string
Identifier
ScriptName This property is required. string
Name of the script.
Strategy This property is required. string
Available values: "percentage".
Versions This property is required. []WorkersDeploymentVersionArgs
Annotations WorkersDeploymentAnnotationsArgs
accountId This property is required. String
Identifier
scriptName This property is required. String
Name of the script.
strategy This property is required. String
Available values: "percentage".
versions This property is required. List<WorkersDeploymentVersion>
annotations WorkersDeploymentAnnotations
accountId This property is required. string
Identifier
scriptName This property is required. string
Name of the script.
strategy This property is required. string
Available values: "percentage".
versions This property is required. WorkersDeploymentVersion[]
annotations WorkersDeploymentAnnotations
account_id This property is required. str
Identifier
script_name This property is required. str
Name of the script.
strategy This property is required. str
Available values: "percentage".
versions This property is required. Sequence[WorkersDeploymentVersionArgs]
annotations WorkersDeploymentAnnotationsArgs
accountId This property is required. String
Identifier
scriptName This property is required. String
Name of the script.
strategy This property is required. String
Available values: "percentage".
versions This property is required. List<Property Map>
annotations Property Map

Outputs

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

AuthorEmail string
CreatedOn string
Deployments List<WorkersDeploymentDeployment>
Id string
The provider-assigned unique ID for this managed resource.
Source string
AuthorEmail string
CreatedOn string
Deployments []WorkersDeploymentDeployment
Id string
The provider-assigned unique ID for this managed resource.
Source string
authorEmail String
createdOn String
deployments List<WorkersDeploymentDeployment>
id String
The provider-assigned unique ID for this managed resource.
source String
authorEmail string
createdOn string
deployments WorkersDeploymentDeployment[]
id string
The provider-assigned unique ID for this managed resource.
source string
author_email str
created_on str
deployments Sequence[WorkersDeploymentDeployment]
id str
The provider-assigned unique ID for this managed resource.
source str
authorEmail String
createdOn String
deployments List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
source String

Look up Existing WorkersDeployment Resource

Get an existing WorkersDeployment 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?: WorkersDeploymentState, opts?: CustomResourceOptions): WorkersDeployment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        annotations: Optional[WorkersDeploymentAnnotationsArgs] = None,
        author_email: Optional[str] = None,
        created_on: Optional[str] = None,
        deployments: Optional[Sequence[WorkersDeploymentDeploymentArgs]] = None,
        script_name: Optional[str] = None,
        source: Optional[str] = None,
        strategy: Optional[str] = None,
        versions: Optional[Sequence[WorkersDeploymentVersionArgs]] = None) -> WorkersDeployment
func GetWorkersDeployment(ctx *Context, name string, id IDInput, state *WorkersDeploymentState, opts ...ResourceOption) (*WorkersDeployment, error)
public static WorkersDeployment Get(string name, Input<string> id, WorkersDeploymentState? state, CustomResourceOptions? opts = null)
public static WorkersDeployment get(String name, Output<String> id, WorkersDeploymentState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:WorkersDeployment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
accountId String
Identifier
annotations Property Map
authorEmail String
createdOn String
deployments List<Property Map>
scriptName String
Name of the script.
source String
strategy String
Available values: "percentage".
versions List<Property Map>

Supporting Types

WorkersDeploymentAnnotations
, WorkersDeploymentAnnotationsArgs

WorkersMessage string
Human-readable message about the deployment. Truncated to 100 bytes.
WorkersMessage string
Human-readable message about the deployment. Truncated to 100 bytes.
workersMessage String
Human-readable message about the deployment. Truncated to 100 bytes.
workersMessage string
Human-readable message about the deployment. Truncated to 100 bytes.
workers_message str
Human-readable message about the deployment. Truncated to 100 bytes.
workersMessage String
Human-readable message about the deployment. Truncated to 100 bytes.

WorkersDeploymentDeployment
, WorkersDeploymentDeploymentArgs

annotations Property Map
authorEmail String
createdOn String
id String
source String
strategy String
Available values: "percentage".
versions List<Property Map>

WorkersDeploymentDeploymentAnnotations
, WorkersDeploymentDeploymentAnnotationsArgs

WorkersMessage string
Human-readable message about the deployment. Truncated to 100 bytes.
WorkersMessage string
Human-readable message about the deployment. Truncated to 100 bytes.
workersMessage String
Human-readable message about the deployment. Truncated to 100 bytes.
workersMessage string
Human-readable message about the deployment. Truncated to 100 bytes.
workers_message str
Human-readable message about the deployment. Truncated to 100 bytes.
workersMessage String
Human-readable message about the deployment. Truncated to 100 bytes.

WorkersDeploymentDeploymentVersion
, WorkersDeploymentDeploymentVersionArgs

Percentage double
VersionId string
Percentage float64
VersionId string
percentage Double
versionId String
percentage number
versionId string
percentage Number
versionId String

WorkersDeploymentVersion
, WorkersDeploymentVersionArgs

Percentage This property is required. double
VersionId This property is required. string
Percentage This property is required. float64
VersionId This property is required. string
percentage This property is required. Double
versionId This property is required. String
percentage This property is required. number
versionId This property is required. string
percentage This property is required. float
version_id This property is required. str
percentage This property is required. Number
versionId This property is required. String

Import

$ pulumi import cloudflare:index/workersDeployment:WorkersDeployment example '<account_id>/<script_name>'
Copy

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.