1. Packages
  2. Buildkite
  3. API Docs
  4. Pipeline
  5. Schedule
Buildkite v2.3.1 published on Monday, Sep 11, 2023 by Pulumiverse

buildkite.Pipeline.Schedule

Explore with Pulumi AI

buildkite logo
Buildkite v2.3.1 published on Monday, Sep 11, 2023 by Pulumiverse

    # Resource: pipeline_schedule

    This resource allows you to create and manage pipeline schedules.

    Buildkite Documentation: https://buildkite.com/docs/pipelines/scheduled-builds

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Buildkite = Pulumiverse.Buildkite;
    
    return await Deployment.RunAsync(() => 
    {
        var repo2Nightly = new Buildkite.Pipeline.Schedule("repo2Nightly", new()
        {
            PipelineId = buildkite_pipeline.Repo2.Id,
            Label = "Nightly build",
            Cronline = "@midnight",
            Branch = buildkite_pipeline.Repo2.Default_branch,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-buildkite/sdk/v2/go/buildkite/Pipeline"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Pipeline.NewSchedule(ctx, "repo2Nightly", &Pipeline.ScheduleArgs{
    			PipelineId: pulumi.Any(buildkite_pipeline.Repo2.Id),
    			Label:      pulumi.String("Nightly build"),
    			Cronline:   pulumi.String("@midnight"),
    			Branch:     pulumi.Any(buildkite_pipeline.Repo2.Default_branch),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.buildkite.Pipeline.Schedule;
    import com.pulumi.buildkite.Pipeline.ScheduleArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 repo2Nightly = new Schedule("repo2Nightly", ScheduleArgs.builder()        
                .pipelineId(buildkite_pipeline.repo2().id())
                .label("Nightly build")
                .cronline("@midnight")
                .branch(buildkite_pipeline.repo2().default_branch())
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_buildkite as buildkite
    
    repo2_nightly = buildkite.pipeline.Schedule("repo2Nightly",
        pipeline_id=buildkite_pipeline["repo2"]["id"],
        label="Nightly build",
        cronline="@midnight",
        branch=buildkite_pipeline["repo2"]["default_branch"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as buildkite from "@pulumiverse/buildkite";
    
    const repo2Nightly = new buildkite.pipeline.Schedule("repo2Nightly", {
        pipelineId: buildkite_pipeline.repo2.id,
        label: "Nightly build",
        cronline: "@midnight",
        branch: buildkite_pipeline.repo2.default_branch,
    });
    
    resources:
      repo2Nightly:
        type: buildkite:Pipeline:Schedule
        properties:
          pipelineId: ${buildkite_pipeline.repo2.id}
          label: Nightly build
          cronline: '@midnight'
          branch: ${buildkite_pipeline.repo2.default_branch}
    

    Create Schedule Resource

    new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);
    @overload
    def Schedule(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 branch: Optional[str] = None,
                 commit: Optional[str] = None,
                 cronline: Optional[str] = None,
                 enabled: Optional[bool] = None,
                 env: Optional[Mapping[str, str]] = None,
                 label: Optional[str] = None,
                 message: Optional[str] = None,
                 pipeline_id: Optional[str] = None)
    @overload
    def Schedule(resource_name: str,
                 args: ScheduleArgs,
                 opts: Optional[ResourceOptions] = None)
    func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)
    public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)
    public Schedule(String name, ScheduleArgs args)
    public Schedule(String name, ScheduleArgs args, CustomResourceOptions options)
    
    type: buildkite:Pipeline:Schedule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ScheduleArgs
    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 ScheduleArgs
    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 ScheduleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ScheduleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ScheduleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Schedule Resource Properties

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

    Inputs

    The Schedule resource accepts the following input properties:

    Branch string
    The branch to use for the build.
    Cronline string
    Schedule interval (see docs).
    Label string
    Schedule label.
    PipelineId string
    The ID of the pipeline that this schedule belongs to.
    Commit string
    The commit ref to use for the build.
    Enabled bool
    Whether the schedule should run.
    Env Dictionary<string, string>
    A map of environment variables to use for the build.
    Message string
    The message to use for the build.
    Branch string
    The branch to use for the build.
    Cronline string
    Schedule interval (see docs).
    Label string
    Schedule label.
    PipelineId string
    The ID of the pipeline that this schedule belongs to.
    Commit string
    The commit ref to use for the build.
    Enabled bool
    Whether the schedule should run.
    Env map[string]string
    A map of environment variables to use for the build.
    Message string
    The message to use for the build.
    branch String
    The branch to use for the build.
    cronline String
    Schedule interval (see docs).
    label String
    Schedule label.
    pipelineId String
    The ID of the pipeline that this schedule belongs to.
    commit String
    The commit ref to use for the build.
    enabled Boolean
    Whether the schedule should run.
    env Map<String,String>
    A map of environment variables to use for the build.
    message String
    The message to use for the build.
    branch string
    The branch to use for the build.
    cronline string
    Schedule interval (see docs).
    label string
    Schedule label.
    pipelineId string
    The ID of the pipeline that this schedule belongs to.
    commit string
    The commit ref to use for the build.
    enabled boolean
    Whether the schedule should run.
    env {[key: string]: string}
    A map of environment variables to use for the build.
    message string
    The message to use for the build.
    branch str
    The branch to use for the build.
    cronline str
    Schedule interval (see docs).
    label str
    Schedule label.
    pipeline_id str
    The ID of the pipeline that this schedule belongs to.
    commit str
    The commit ref to use for the build.
    enabled bool
    Whether the schedule should run.
    env Mapping[str, str]
    A map of environment variables to use for the build.
    message str
    The message to use for the build.
    branch String
    The branch to use for the build.
    cronline String
    Schedule interval (see docs).
    label String
    Schedule label.
    pipelineId String
    The ID of the pipeline that this schedule belongs to.
    commit String
    The commit ref to use for the build.
    enabled Boolean
    Whether the schedule should run.
    env Map<String>
    A map of environment variables to use for the build.
    message String
    The message to use for the build.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    The UUID of the pipeline schedule
    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    The UUID of the pipeline schedule
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    The UUID of the pipeline schedule
    id string
    The provider-assigned unique ID for this managed resource.
    uuid string
    The UUID of the pipeline schedule
    id str
    The provider-assigned unique ID for this managed resource.
    uuid str
    The UUID of the pipeline schedule
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    The UUID of the pipeline schedule

    Look up Existing Schedule Resource

    Get an existing Schedule 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?: ScheduleState, opts?: CustomResourceOptions): Schedule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            branch: Optional[str] = None,
            commit: Optional[str] = None,
            cronline: Optional[str] = None,
            enabled: Optional[bool] = None,
            env: Optional[Mapping[str, str]] = None,
            label: Optional[str] = None,
            message: Optional[str] = None,
            pipeline_id: Optional[str] = None,
            uuid: Optional[str] = None) -> Schedule
    func GetSchedule(ctx *Context, name string, id IDInput, state *ScheduleState, opts ...ResourceOption) (*Schedule, error)
    public static Schedule Get(string name, Input<string> id, ScheduleState? state, CustomResourceOptions? opts = null)
    public static Schedule get(String name, Output<String> id, ScheduleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Branch string
    The branch to use for the build.
    Commit string
    The commit ref to use for the build.
    Cronline string
    Schedule interval (see docs).
    Enabled bool
    Whether the schedule should run.
    Env Dictionary<string, string>
    A map of environment variables to use for the build.
    Label string
    Schedule label.
    Message string
    The message to use for the build.
    PipelineId string
    The ID of the pipeline that this schedule belongs to.
    Uuid string
    The UUID of the pipeline schedule
    Branch string
    The branch to use for the build.
    Commit string
    The commit ref to use for the build.
    Cronline string
    Schedule interval (see docs).
    Enabled bool
    Whether the schedule should run.
    Env map[string]string
    A map of environment variables to use for the build.
    Label string
    Schedule label.
    Message string
    The message to use for the build.
    PipelineId string
    The ID of the pipeline that this schedule belongs to.
    Uuid string
    The UUID of the pipeline schedule
    branch String
    The branch to use for the build.
    commit String
    The commit ref to use for the build.
    cronline String
    Schedule interval (see docs).
    enabled Boolean
    Whether the schedule should run.
    env Map<String,String>
    A map of environment variables to use for the build.
    label String
    Schedule label.
    message String
    The message to use for the build.
    pipelineId String
    The ID of the pipeline that this schedule belongs to.
    uuid String
    The UUID of the pipeline schedule
    branch string
    The branch to use for the build.
    commit string
    The commit ref to use for the build.
    cronline string
    Schedule interval (see docs).
    enabled boolean
    Whether the schedule should run.
    env {[key: string]: string}
    A map of environment variables to use for the build.
    label string
    Schedule label.
    message string
    The message to use for the build.
    pipelineId string
    The ID of the pipeline that this schedule belongs to.
    uuid string
    The UUID of the pipeline schedule
    branch str
    The branch to use for the build.
    commit str
    The commit ref to use for the build.
    cronline str
    Schedule interval (see docs).
    enabled bool
    Whether the schedule should run.
    env Mapping[str, str]
    A map of environment variables to use for the build.
    label str
    Schedule label.
    message str
    The message to use for the build.
    pipeline_id str
    The ID of the pipeline that this schedule belongs to.
    uuid str
    The UUID of the pipeline schedule
    branch String
    The branch to use for the build.
    commit String
    The commit ref to use for the build.
    cronline String
    Schedule interval (see docs).
    enabled Boolean
    Whether the schedule should run.
    env Map<String>
    A map of environment variables to use for the build.
    label String
    Schedule label.
    message String
    The message to use for the build.
    pipelineId String
    The ID of the pipeline that this schedule belongs to.
    uuid String
    The UUID of the pipeline schedule

    Import

    Pipeline schedules can be imported using their GraphQL ID, e.g.

     $ pulumi import buildkite:Pipeline/schedule:Schedule test UGlwZWxpgm5Tf2hhZHVsZ35tLWRk4DdmN7c4LTA5M2ItNDM9YS0gMWE0LTAwZDUgYTAxYvRf49==
    

    Your pipeline schedules’ GraphQL ID can be found with the below GraphQL query below. Alternatively, you could use this pre-saved query, specifying the organisation slug (when known) and the pipeline search term (PIPELINE_SEARCH_TERM). graphql query getPipelineScheduleId {

    organization(slug"ORGANIZATION_SLUG") { pipelines(first5, search"PIPELINE_SEARCH_TERM") {

    edges{

    node{

    name

    schedules{

    edges{

    node{

    id

    }

    }

    }

    }

    }

    }

    } }

    Package Details

    Repository
    buildkite pulumiverse/pulumi-buildkite
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the buildkite Terraform Provider.
    buildkite logo
    Buildkite v2.3.1 published on Monday, Sep 11, 2023 by Pulumiverse