1. Registry
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. WorkersCronTrigger
Viewing docs for Cloudflare v6.24.0
published on Thursday, Nov 12, 2026 by Pulumi
cloudflare logo cloudflare logo
Viewing docs for Cloudflare v6.24.0
published on Thursday, Nov 12, 2026 by Pulumi

    Accepted Permissions

    • Individual Workers Admin
    • Individual Workers Content Read-Only
    • Individual Workers Editor
    • Individual Workers Metadata Read-Only
    • Workers Admin
    • Workers Content Read-Only
    • Workers Editor
    • Workers Metadata Read-Only
    • Workers Scripts Read
    • Workers Scripts Write

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleWorkersCronTrigger = new cloudflare.WorkersCronTrigger("example_workers_cron_trigger", {
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        scriptName: "this-is_my_script-01",
        schedules: [{
            cron: "*/30 * * * *",
        }],
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_workers_cron_trigger = cloudflare.WorkersCronTrigger("example_workers_cron_trigger",
        account_id="023e105f4ecef8ad9ca31a8372d0c353",
        script_name="this-is_my_script-01",
        schedules=[{
            "cron": "*/30 * * * *",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewWorkersCronTrigger(ctx, "example_workers_cron_trigger", &cloudflare.WorkersCronTriggerArgs{
    			AccountId:  pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			ScriptName: pulumi.String("this-is_my_script-01"),
    			Schedules: cloudflare.WorkersCronTriggerScheduleArray{
    				&cloudflare.WorkersCronTriggerScheduleArgs{
    					Cron: pulumi.String("*/30 * * * *"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleWorkersCronTrigger = new Cloudflare.WorkersCronTrigger("example_workers_cron_trigger", new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            ScriptName = "this-is_my_script-01",
            Schedules = new[]
            {
                new Cloudflare.Inputs.WorkersCronTriggerScheduleArgs
                {
                    Cron = "*/30 * * * *",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.WorkersCronTrigger;
    import com.pulumi.cloudflare.WorkersCronTriggerArgs;
    import com.pulumi.cloudflare.inputs.WorkersCronTriggerScheduleArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleWorkersCronTrigger = new WorkersCronTrigger("exampleWorkersCronTrigger", WorkersCronTriggerArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .scriptName("this-is_my_script-01")
                .schedules(WorkersCronTriggerScheduleArgs.builder()
                    .cron("*/30 * * * *")
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleWorkersCronTrigger:
        type: cloudflare:WorkersCronTrigger
        name: example_workers_cron_trigger
        properties:
          accountId: 023e105f4ecef8ad9ca31a8372d0c353
          scriptName: this-is_my_script-01
          schedules:
            - cron: '*/30 * * * *'
    
    terraform {
      required_providers {
        cloudflare = {
          source = "pulumi/cloudflare"
        }
      }
    }
    
    resource "cloudflare_workers_cron_trigger" "example_workers_cron_trigger" {
      lifecycle {
        create_before_destroy = true
      }
      account_id  = "023e105f4ecef8ad9ca31a8372d0c353"
      script_name = "this-is_my_script-01"
      schedules = [{
        cron = "*/30 * * * *"
      }]
    }
    

    Create WorkersCronTrigger Resource

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

    Constructor syntax

    new WorkersCronTrigger(name: string, args: WorkersCronTriggerArgs, opts?: CustomResourceOptions);
    @overload
    def WorkersCronTrigger(resource_name: str,
                           args: WorkersCronTriggerArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkersCronTrigger(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           account_id: Optional[str] = None,
                           schedules: Optional[Sequence[WorkersCronTriggerScheduleArgs]] = None,
                           script_name: Optional[str] = None)
    func NewWorkersCronTrigger(ctx *Context, name string, args WorkersCronTriggerArgs, opts ...ResourceOption) (*WorkersCronTrigger, error)
    public WorkersCronTrigger(string name, WorkersCronTriggerArgs args, CustomResourceOptions? opts = null)
    public WorkersCronTrigger(String name, WorkersCronTriggerArgs args)
    public WorkersCronTrigger(String name, WorkersCronTriggerArgs args, CustomResourceOptions options)
    
    type: cloudflare:WorkersCronTrigger
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "cloudflare_workers_cron_trigger" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args WorkersCronTriggerArgs
    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 WorkersCronTriggerArgs
    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 WorkersCronTriggerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkersCronTriggerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkersCronTriggerArgs
    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 workersCronTriggerResource = new Cloudflare.WorkersCronTrigger("workersCronTriggerResource", new()
    {
        AccountId = "string",
        Schedules = new[]
        {
            new Cloudflare.Inputs.WorkersCronTriggerScheduleArgs
            {
                Cron = "string",
                CreatedOn = "string",
                ModifiedOn = "string",
            },
        },
        ScriptName = "string",
    });
    
    example, err := cloudflare.NewWorkersCronTrigger(ctx, "workersCronTriggerResource", &cloudflare.WorkersCronTriggerArgs{
    	AccountId: pulumi.String("string"),
    	Schedules: cloudflare.WorkersCronTriggerScheduleArray{
    		&cloudflare.WorkersCronTriggerScheduleArgs{
    			Cron:       pulumi.String("string"),
    			CreatedOn:  pulumi.String("string"),
    			ModifiedOn: pulumi.String("string"),
    		},
    	},
    	ScriptName: pulumi.String("string"),
    })
    
    resource "cloudflare_workers_cron_trigger" "workersCronTriggerResource" {
      lifecycle {
        create_before_destroy = true
      }
      account_id = "string"
      schedules {
        cron        = "string"
        created_on  = "string"
        modified_on = "string"
      }
      script_name = "string"
    }
    
    var workersCronTriggerResource = new WorkersCronTrigger("workersCronTriggerResource", WorkersCronTriggerArgs.builder()
        .accountId("string")
        .schedules(WorkersCronTriggerScheduleArgs.builder()
            .cron("string")
            .createdOn("string")
            .modifiedOn("string")
            .build())
        .scriptName("string")
        .build());
    
    workers_cron_trigger_resource = cloudflare.WorkersCronTrigger("workersCronTriggerResource",
        account_id="string",
        schedules=[{
            "cron": "string",
            "created_on": "string",
            "modified_on": "string",
        }],
        script_name="string")
    
    const workersCronTriggerResource = new cloudflare.WorkersCronTrigger("workersCronTriggerResource", {
        accountId: "string",
        schedules: [{
            cron: "string",
            createdOn: "string",
            modifiedOn: "string",
        }],
        scriptName: "string",
    });
    
    type: cloudflare:WorkersCronTrigger
    properties:
        accountId: string
        schedules:
            - createdOn: string
              cron: string
              modifiedOn: string
        scriptName: string
    

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

    AccountId string
    Identifier.
    Schedules List<WorkersCronTriggerSchedule>
    ScriptName string
    Name of the script.
    AccountId string
    Identifier.
    Schedules []WorkersCronTriggerScheduleArgs
    ScriptName string
    Name of the script.
    account_id string
    Identifier.
    schedules list(object)
    script_name string
    Name of the script.
    accountId String
    Identifier.
    schedules List<WorkersCronTriggerSchedule>
    scriptName String
    Name of the script.
    accountId string
    Identifier.
    schedules WorkersCronTriggerSchedule[]
    scriptName string
    Name of the script.
    accountId String
    Identifier.
    schedules List<Property Map>
    scriptName String
    Name of the script.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WorkersCronTrigger 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 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.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing WorkersCronTrigger Resource

    Get an existing WorkersCronTrigger 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?: WorkersCronTriggerState, opts?: CustomResourceOptions): WorkersCronTrigger
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            schedules: Optional[Sequence[WorkersCronTriggerScheduleArgs]] = None,
            script_name: Optional[str] = None) -> WorkersCronTrigger
    func GetWorkersCronTrigger(ctx *Context, name string, id IDInput, state *WorkersCronTriggerState, opts ...ResourceOption) (*WorkersCronTrigger, error)
    public static WorkersCronTrigger Get(string name, Input<string> id, WorkersCronTriggerState? state, CustomResourceOptions? opts = null)
    public static WorkersCronTrigger get(String name, Output<String> id, WorkersCronTriggerState state, CustomResourceOptions options)
    resources:  existingWorkersCronTrigger:    type: cloudflare:WorkersCronTrigger    get:      id: ${id}
    import {
      to = cloudflare_workers_cron_trigger.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state WorkersCronTriggerState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    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 resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state WorkersCronTriggerState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state WorkersCronTriggerState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state WorkersCronTriggerState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    AccountId string
    Identifier.
    Schedules List<WorkersCronTriggerSchedule>
    ScriptName string
    Name of the script.
    AccountId string
    Identifier.
    Schedules []WorkersCronTriggerScheduleArgs
    ScriptName string
    Name of the script.
    account_id string
    Identifier.
    schedules list(object)
    script_name string
    Name of the script.
    accountId String
    Identifier.
    schedules List<WorkersCronTriggerSchedule>
    scriptName String
    Name of the script.
    accountId string
    Identifier.
    schedules WorkersCronTriggerSchedule[]
    scriptName string
    Name of the script.
    accountId String
    Identifier.
    schedules List<Property Map>
    scriptName String
    Name of the script.

    Supporting Types

    WorkersCronTriggerSchedule, WorkersCronTriggerScheduleArgs

    Cron string
    CreatedOn string
    ModifiedOn string
    Cron string
    CreatedOn string
    ModifiedOn string
    cron string
    created_on string
    modified_on string
    cron String
    createdOn String
    modifiedOn String
    cron string
    createdOn string
    modifiedOn string
    cron String
    createdOn String
    modifiedOn String

    Import

    $ pulumi import cloudflare:index/workersCronTrigger:WorkersCronTrigger 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 logo
    Viewing docs for Cloudflare v6.24.0
    published on Thursday, Nov 12, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial