1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WorkersDeployment
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.WorkersDeployment

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    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.
    

    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 string
    The unique name of the resource.
    args WorkersDeploymentArgs
    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 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 string
    The unique name of the resource.
    args WorkersDeploymentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkersDeploymentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
        },
    });
    
    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"),
    	},
    })
    
    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());
    
    workers_deployment_resource = cloudflare.WorkersDeployment("workersDeploymentResource",
        account_id="string",
        script_name="string",
        strategy="string",
        versions=[{
            "percentage": 0,
            "version_id": "string",
        }],
        annotations={
            "workers_message": "string",
        })
    
    const workersDeploymentResource = new cloudflare.WorkersDeployment("workersDeploymentResource", {
        accountId: "string",
        scriptName: "string",
        strategy: "string",
        versions: [{
            percentage: 0,
            versionId: "string",
        }],
        annotations: {
            workersMessage: "string",
        },
    });
    
    type: cloudflare:WorkersDeployment
    properties:
        accountId: string
        annotations:
            workersMessage: string
        scriptName: string
        strategy: string
        versions:
            - percentage: 0
              versionId: string
    

    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 string
    Identifier.
    ScriptName string
    Name of the script.
    Strategy string
    Available values: "percentage".
    Versions List<WorkersDeploymentVersion>
    Annotations WorkersDeploymentAnnotations
    AccountId string
    Identifier.
    ScriptName string
    Name of the script.
    Strategy string
    Available values: "percentage".
    Versions []WorkersDeploymentVersionArgs
    Annotations WorkersDeploymentAnnotationsArgs
    accountId String
    Identifier.
    scriptName String
    Name of the script.
    strategy String
    Available values: "percentage".
    versions List<WorkersDeploymentVersion>
    annotations WorkersDeploymentAnnotations
    accountId string
    Identifier.
    scriptName string
    Name of the script.
    strategy string
    Available values: "percentage".
    versions WorkersDeploymentVersion[]
    annotations WorkersDeploymentAnnotations
    accountId String
    Identifier.
    scriptName String
    Name of the script.
    strategy String
    Available values: "percentage".
    versions 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
    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.
    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 double
    VersionId string
    Percentage float64
    VersionId string
    percentage Double
    versionId String
    percentage number
    versionId string
    percentage Number
    versionId String

    Import

    $ pulumi import cloudflare:index/workersDeployment:WorkersDeployment 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.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi